diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-01-06 20:56:54 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-01-06 22:02:27 +0100 |
| commit | 0cdb09d48944df3f13cc1a4e1f5c49b786174ef9 (patch) | |
| tree | 6fa089d32660c286d06f0ffaf1ad9de28e4893ac /django/template | |
| parent | ed220c4cbea04c2e77535af93bcfaa917cce607a (diff) | |
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.
Diffstat (limited to 'django/template')
| -rw-r--r-- | django/template/backends/django.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/django/template/backends/django.py b/django/template/backends/django.py index 580d789a67..63747f7c7f 100644 --- a/django/template/backends/django.py +++ b/django/template/backends/django.py @@ -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) |
