Skip to content

Commit c98223f

Browse files
Ryan P KilbyCarlton Gibson
authored andcommitted
Pass on invalid value (Inf, NaN) encoding in JSONBoundField
1 parent 901657e commit c98223f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/utils/serializer_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def as_form_field(self):
8888
value = self.value
8989
try:
9090
value = json.dumps(self.value, sort_keys=True, indent=4)
91-
except TypeError:
91+
except (TypeError, ValueError):
9292
pass
9393
return self.__class__(self._field, value, self.errors, self._prefix)
9494

0 commit comments

Comments
 (0)