Fix problems with {% url %} overrides.

Review Request #2021 — Created Dec. 29, 2010 and submitted

Information

Review Board
master

Reviewers

Fix problems with {% url %} overrides.

There were a couple problems with our override of the url templatetag, which
mostly stemmed from the fact that reviewboard.site.templatetags wasn't always
being called in every python instance.

 
chipx86
  1. 
      
  2. reviewboard/reviews/templatetags/reviewtags.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
    We'll want to copy the context and use the copy, as we don't want to mess with the parent context.
  3. 
      
david
Review request changed
Change Summary:
Copy the Context object before updating it.
chipx86
  1. 
      
  2. That'll still update context. Use context.copy().
  3. 
      
david
  1. 
      
  2. I can't reply because of the jsconsts bug, so here's my answer:
    
    "context" here isn't a dict, it's a django.template.Context object, which doesn't have a copy() method, and also doesn't share storage in the same way that dicts do.
  3. 
      
chipx86
  1. Ship It!
  2.