diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-12-09 16:17:56 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-12-09 16:18:52 +0100 |
| commit | d6bad2e9ea77ce48ee5755a7b44682d892bfa3d4 (patch) | |
| tree | 4edec939d50712b5eafd8ea9e8199f5117eff45f /django | |
| parent | fce779475e221e322a25dbf30dc25003e831afc2 (diff) | |
[1.5.x] Fixed #19392 -- Improved error for old-style url tags with dashes.
Thanks dloewenherz for the report.
Backport of 4951932 from master.
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/defaulttags.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 |
