You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactoring between 3.3.3 and 3.4.0 changed how Response.render passes media_type to its renderer.
Response sets it as media_type = renderer.media_type compared to self.accepted_media_type (set via APIView.finalize_responsehere).
Since renderer.media_type looses the indent parameter (i.e. application/json; indent=4 becomes application/json), the resulting JSON rendering is not indented.
A 'simple' fix is to restore the 3.3.3 code where media_type = getattr(self, 'accepted_media_type', None) but I haven't made a PR yet because I'm not clear as to whether there was a specific reason for changing to renderer.media_type (which might have overlooked that it doesn't include indent).
The text was updated successfully, but these errors were encountered:
Refactoring between 3.3.3 and 3.4.0 changed how
Response.render
passesmedia_type
to itsrenderer
.Response sets it as
media_type = renderer.media_type
compared toself.accepted_media_type
(set viaAPIView.finalize_response
here).Since
renderer.media_type
looses the indent parameter (i.e.application/json; indent=4
becomesapplication/json
), the resulting JSON rendering is not indented.A 'simple' fix is to restore the 3.3.3 code where
media_type = getattr(self, 'accepted_media_type', None)
but I haven't made a PR yet because I'm not clear as to whether there was a specific reason for changing torenderer.media_type
(which might have overlooked that it doesn't includeindent
).The text was updated successfully, but these errors were encountered: