Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix response rendering with empty context #4495

Merged
merged 1 commit into from Sep 17, 2016
Merged

Fix response rendering with empty context #4495

merged 1 commit into from Sep 17, 2016

Conversation

OJFord
Copy link
Contributor

@OJFord OJFord commented Sep 16, 2016

This PR allows response.render to be called when response.rendered_context == {}.

I believe this should be allowed, since if the JSONRenderer, for example receives a None context, it sets it to an empty dictionary itself.

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.
@OJFord OJFord changed the title fixes response rendering with empty context Fix response rendering with empty context Sep 16, 2016
@tomchristie tomchristie merged commit fe96cec into encode:master Sep 17, 2016
2 checks passed
@tomchristie
Copy link
Member

tomchristie commented Sep 17, 2016

Seems fair. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants