mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Merge 89fa0d53cc
into d2286ba658
This commit is contained in:
commit
07ffec7fd0
|
@ -99,10 +99,17 @@ class JSONRenderer(BaseRenderer):
|
|||
else:
|
||||
separators = INDENT_SEPARATORS
|
||||
|
||||
ret = json.dumps(
|
||||
data, cls=self.encoder_class,
|
||||
indent=indent, ensure_ascii=self.ensure_ascii,
|
||||
separators=separators
|
||||
if type(data) is dict:
|
||||
ret = json.dumps(
|
||||
data, cls=self.encoder_class,
|
||||
indent=indent, ensure_ascii=self.ensure_ascii,
|
||||
separators=separators, sort_keys=True
|
||||
)
|
||||
else:
|
||||
ret = json.dumps(
|
||||
data, cls=self.encoder_class,
|
||||
indent=indent, ensure_ascii=self.ensure_ascii,
|
||||
separators=separators
|
||||
)
|
||||
|
||||
# On python 2.x json.dumps() returns bytestrings if ensure_ascii=True,
|
||||
|
|
Loading…
Reference in New Issue
Block a user