Django

Code

Changeset 7261

Show
Ignore:
Timestamp:
03/17/08 09:55:30 (4 months ago)
Author:
mtredinnick
Message:

Fixed #4539 -- Fixed a subtle context resolving bug in the i18n template tag.
Excellent debugging from permonik@mesias.brnonet.cz.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/templatetags/i18n.py

    r6689 r7261  
    6767 
    6868    def render(self, context): 
    69         context.push() 
     69        tmp_context = {} 
    7070        for var, val in self.extra_context.items(): 
    71             context[var] = val.render(context) 
     71            tmp_context[var] = val.render(context) 
     72        # Update() works like a push(), so corresponding context.pop() is at 
     73        # the end of function 
     74        context.update(tmp_context) 
    7275        singular, vars = self.render_token_list(self.singular) 
    7376        if self.plural and self.countervar and self.counter: