1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[1.5.x] Fixed #19280 -- Raised an explicit exception for the old {% url %} syntax.

Backport of 6b8a7ce.
This commit is contained in:
Aymeric Augustin
2012-11-24 22:04:17 +01:00
parent f1afd57a32
commit 8c2f36260e
3 changed files with 24 additions and 1 deletions

View File

@@ -398,6 +398,10 @@ class URLNode(Node):
view_name = self.view_name.resolve(context)
if not view_name:
raise TemplateSyntaxError("'url' takes requires a non-empty first"
" argument. The syntax changed in Django 1.5, see the docs.")
# 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 unless we're using the