Version 3.4.3 (#4361)

* Version 3.4.3
This commit is contained in:
Tom Christie 2016-08-05 13:33:25 +01:00 committed by GitHub
parent 35320b1f2d
commit bb613c5ad1
3 changed files with 20 additions and 3 deletions

View File

@ -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]
@ -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
@ -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

View File

@ -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'

View File

@ -166,7 +166,11 @@ class TemplateHTMLRenderer(BaseRenderer):
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)
else:
context = self.get_template_context(data, renderer_context)
return template_render(template, context, request=request)
def resolve_template(self, template_names):
@ -229,7 +233,10 @@ class StaticHTMLRenderer(TemplateHTMLRenderer):
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