#19392: Old-style url names (with dashes) throw confusing template traceback
---------------------------------+------------------------
     Reporter:  dloewenherz      |      Owner:  nobody
         Type:  Uncategorized    |     Status:  new
    Component:  Template system  |    Version:  1.5-beta-1
     Severity:  Normal           |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+------------------------
 When migrating an existing project to Django 1.5 (one that has dashes in
 the URL names), I get a very confusing error in the template traceback.
 Namely:

 {{{
 TemplateSyntaxError at /
 Could not parse the remainder: '-login' from 'account-login'
 }}}

 {{{
 <li><a href='{% url account-login %}'>Create Account</a></li>
 }}}

 The culprit is in the `filter_raw_string` regex in
 django/template/base.py. When I change 'var_chars' to `"-\w\."`(instead of
 `"\w\."`, I get a more sensible error message:

 {{{
 NoReverseMatch at /
 'url' requires a non-empty first argument. The syntax changed in Django
 1.5, see the docs.
 }}}

 I think the messaging here could be improved.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19392>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to