1
0
mirror of https://github.com/django/django.git synced 2025-10-28 08:06:09 +00:00

Made context take priority over context processors.

This is the expected behavior, but given RequestContext's tortuous
implementation, a straightforward use of its API results in the
opposite.

This commits fixes a regression that must have happened at different
points in the multiple templates engine refactor for different features.
This commit is contained in:
Aymeric Augustin
2015-01-06 20:56:54 +01:00
parent ed220c4cbe
commit 0cdb09d489
2 changed files with 32 additions and 1 deletions

View File

@@ -45,5 +45,11 @@ class Template(object):
if request is None:
context = Context(context)
else:
context = RequestContext(request, context)
# The following pattern is required to ensure values from
# context override those from template context processors.
original_context = context
context = RequestContext(request)
if original_context:
context.push(original_context)
return self.template.render(context)