mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 03:50:11 +03:00
Fix non-JSON output from JSONRenderer
The render method of JSONRenderer returns b'' when the input is None, but that is not valid JSON. If the check at the beginning of the render method is removed it will (IMHO correctly) return b'null'.
This commit is contained in:
parent
47f5bd488d
commit
33b38226db
|
@ -62,9 +62,6 @@ class JSONRenderer(BaseRenderer):
|
|||
"""
|
||||
Render `data` into JSON.
|
||||
"""
|
||||
if data is None:
|
||||
return bytes()
|
||||
|
||||
# If 'indent' is provided in the context, then pretty print the result.
|
||||
# E.g. If we're being called by the BrowsableAPIRenderer.
|
||||
renderer_context = renderer_context or {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user