1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #19392 -- Improved error for old-style url tags with dashes.

Thanks dloewenherz for the report.
This commit is contained in:
Aymeric Augustin
2012-12-09 16:17:56 +01:00
parent 8248d14029
commit 49519328b4
2 changed files with 13 additions and 2 deletions

View File

@@ -1262,7 +1262,12 @@ def url(parser, token):
if len(bits) < 2:
raise TemplateSyntaxError("'%s' takes at least one argument"
" (path to a view)" % bits[0])
viewname = parser.compile_filter(bits[1])
try:
viewname = parser.compile_filter(bits[1])
except TemplateSyntaxError as exc:
exc.args = (exc.args[0] + ". "
"The syntax of 'url' changed in Django 1.5, see the docs."),
raise
args = []
kwargs = {}
asvar = None