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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user