From 49519328b4988bf89c11d50191cdee8e9bec3aaa Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 9 Dec 2012 16:17:56 +0100 Subject: Fixed #19392 -- Improved error for old-style url tags with dashes. Thanks dloewenherz for the report. --- django/template/defaulttags.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'django') diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 45f4c1dbb1..aca2f41f2d 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -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 -- cgit v1.3