Skip to content

Commit

Permalink
Version 3.4.3 (#4361)
Browse files Browse the repository at this point in the history
* Version 3.4.3
  • Loading branch information
tomchristie authored Aug 5, 2016
1 parent 35320b1 commit bb613c5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
10 changes: 10 additions & 0 deletions docs/topics/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ You can determine your currently installed version using `pip freeze`:

## 3.4.x series

### 3.4.3

**Date**: [5th August 2016][3.4.3-milestone]

* Include fallaback for users of older TemplateHTMLRenderer internal API. ([#4361][gh4361])

### 3.4.2

**Date**: [5th August 2016][3.4.2-milestone]
Expand Down Expand Up @@ -533,6 +539,7 @@ For older release notes, [please see the version 2.x documentation][old-release-
[3.4.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.0+Release%22
[3.4.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.1+Release%22
[3.4.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.2+Release%22
[3.4.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.3+Release%22

<!-- 3.0.1 -->
[gh2013]: https://github.com/tomchristie/django-rest-framework/issues/2013
Expand Down Expand Up @@ -990,3 +997,6 @@ For older release notes, [please see the version 2.x documentation][old-release-
[gh4357]: https://github.com/tomchristie/django-rest-framework/issues/4357
[gh4358]: https://github.com/tomchristie/django-rest-framework/issues/4358
[gh4359]: https://github.com/tomchristie/django-rest-framework/issues/4359

<!-- 3.4.3 -->
[gh4361]: https://github.com/tomchristie/django-rest-framework/issues/4361
2 changes: 1 addition & 1 deletion rest_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""

__title__ = 'Django REST framework'
__version__ = '3.4.2'
__version__ = '3.4.3'
__author__ = 'Tom Christie'
__license__ = 'BSD 2-Clause'
__copyright__ = 'Copyright 2011-2016 Tom Christie'
Expand Down
11 changes: 9 additions & 2 deletions rest_framework/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ def render(self, data, accepted_media_type=None, renderer_context=None):
template_names = self.get_template_names(response, view)
template = self.resolve_template(template_names)

context = self.get_template_context(data, renderer_context)
if hasattr(self, 'resolve_context'):
# Fallback for older versions.
context = self.resolve_context(self, data, request, response)

This comment has been minimized.

Copy link
@wylee

wylee Aug 9, 2016

self shouldn't be passed to this call to self.resolve_context().

This comment has been minimized.

Copy link
@tomchristie

tomchristie Aug 9, 2016

Author Member

Yup, good catch.

This comment has been minimized.

Copy link
@tomchristie

tomchristie Aug 9, 2016

Author Member

Resolved in #4371

else:
context = self.get_template_context(data, renderer_context)
return template_render(template, context, request=request)

def resolve_template(self, template_names):
Expand Down Expand Up @@ -229,7 +233,10 @@ def render(self, data, accepted_media_type=None, renderer_context=None):
if response and response.exception:
request = renderer_context['request']
template = self.get_exception_template(response)
context = self.resolve_context(data, request, response)
if hasattr(self, 'resolve_context'):
context = self.resolve_context(data, request, response)
else:
context = self.get_template_context(data, renderer_context)
return template_render(template, context, request=request)

return data
Expand Down

0 comments on commit bb613c5

Please sign in to comment.