Permalink
Browse files

Removed conflicting var name

  • Loading branch information...
1 parent 69faab1 commit 755287f155c18ccabe69f1318bacdaca14f55da3 @dcramer committed Feb 27, 2009
Showing with 7 additions and 5 deletions.
  1. +7 −5 jinja/contrib/_djangosupport.py
@@ -134,19 +134,21 @@ def add_author(context, author=None):
# {% url %} template tag (used as {{ url }})
from django.core.urlresolvers import reverse, NoReverseMatch
def url(view_name, *args, **kwargs):
- url = ''
+ # Try to look up the URL twice: once given the view name, and again
+ # relative to what we guess is the "main" app. If they both fail,
+ # re-raise the NoReverseMatch
+ match = ''
try:
- url = reverse(view_name, args=args, kwargs=kwargs)
+ match = reverse(view_name, args=args, kwargs=kwargs)
except NoReverseMatch:
project_name = settings.SETTINGS_MODULE.split('.')[0]
try:
- url = reverse(project_name + '.' + view_name,
+ match = reverse(project_name + '.' + view_name,
args=args, kwargs=kwargs)
except NoReverseMatch:
raise
- return url
-
+ return match
def configure(convert_filters=DEFAULT_FILTERS, loader=None, **options):
"""

0 comments on commit 755287f

Please sign in to comment.