mirror of https://github.com/django/django.git
Fixed #4539 -- Fixed a subtle context resolving bug in the i18n template tag.
Excellent debugging from permonik@mesias.brnonet.cz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b5adaec4c2
commit
e461e737d3
|
@ -66,9 +66,12 @@ class BlockTranslateNode(Node):
|
||||||
return ''.join(result), vars
|
return ''.join(result), vars
|
||||||
|
|
||||||
def render(self, context):
|
def render(self, context):
|
||||||
context.push()
|
tmp_context = {}
|
||||||
for var, val in self.extra_context.items():
|
for var, val in self.extra_context.items():
|
||||||
context[var] = val.render(context)
|
tmp_context[var] = val.render(context)
|
||||||
|
# Update() works like a push(), so corresponding context.pop() is at
|
||||||
|
# the end of function
|
||||||
|
context.update(tmp_context)
|
||||||
singular, vars = self.render_token_list(self.singular)
|
singular, vars = self.render_token_list(self.singular)
|
||||||
if self.plural and self.countervar and self.counter:
|
if self.plural and self.countervar and self.counter:
|
||||||
count = self.counter.resolve(context)
|
count = self.counter.resolve(context)
|
||||||
|
|
Loading…
Reference in New Issue