diff --git a/rest_framework/utils/serializer_helpers.py b/rest_framework/utils/serializer_helpers.py index da89d08ff..fa79b6526 100644 --- a/rest_framework/utils/serializer_helpers.py +++ b/rest_framework/utils/serializer_helpers.py @@ -88,7 +88,7 @@ class JSONBoundField(BoundField): value = self.value try: value = json.dumps(self.value, sort_keys=True, indent=4) - except TypeError: + except (TypeError, ValueError): pass return self.__class__(self._field, value, self.errors, self._prefix)