mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 03:20:12 +03:00
account for 204 responses, fix tests
This commit is contained in:
parent
823a20e889
commit
3c90356b68
|
@ -88,6 +88,13 @@ class JSONRenderer(BaseRenderer):
|
|||
"""
|
||||
Render `data` into JSON, returning a bytestring.
|
||||
"""
|
||||
response = None
|
||||
if renderer_context:
|
||||
response = renderer_context.get('response', None)
|
||||
|
||||
if response is not None and response.status_code == 204:
|
||||
return b''
|
||||
|
||||
renderer_context = renderer_context or {}
|
||||
indent = self.get_indent(accepted_media_type, renderer_context)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user