mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
fixes response rendering with empty context (#4495)
This commit allows `response.render` to be called when `response.rendered_context == {}`. This should be allowed, since if [the JSONRenderer, for example](https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/renderers.py#L85-L92) receives a `None` context, it sets it to an empty dictionary itself.
This commit is contained in:
parent
fe4c4fa751
commit
fe96ceced0
|
@ -56,7 +56,7 @@ class Response(SimpleTemplateResponse):
|
|||
|
||||
assert renderer, ".accepted_renderer not set on Response"
|
||||
assert accepted_media_type, ".accepted_media_type not set on Response"
|
||||
assert context, ".renderer_context not set on Response"
|
||||
assert context is not None, ".renderer_context not set on Response"
|
||||
context['response'] = self
|
||||
|
||||
media_type = renderer.media_type
|
||||
|
|
Loading…
Reference in New Issue
Block a user