mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Return strings instead of null
This commit is contained in:
parent
8383e40216
commit
3f5c1425bc
|
@ -59,11 +59,11 @@ class JSONEncoder(json.JSONEncoder):
|
||||||
# internals.
|
# internals.
|
||||||
|
|
||||||
if o != o:
|
if o != o:
|
||||||
text = 'null'
|
text = '"NaN"'
|
||||||
elif o == _inf:
|
elif o == _inf:
|
||||||
text = 'null'
|
text = '"Infinity"'
|
||||||
elif o == _neginf:
|
elif o == _neginf:
|
||||||
text = 'null'
|
text = '"-Infinity"'
|
||||||
else:
|
else:
|
||||||
return _repr(o)
|
return _repr(o)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user