#19280 closed Cleanup/optimization (fixed)
Detect broken {% url %} syntax
| Reported by: | Anssi Kääriäinen | Owned by: | Tome Cvitan |
|---|---|---|---|
| Component: | Template system | Version: | 1.5-alpha-1 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | yes | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
In 1.5 the url syntax change will likely result in users getting this template error:
NoReverseMatch: Reverse for '' with arguments '()' and keyword arguments '{}' not found.
I think we could catch the error in the url tag, and check if we are trying to reverse . If so, add in a hint:
NoReverseMatch: Reverse for '' with arguments '()' and keyword arguments '{}' not found. Note: url syntax has changed in Django 1.5, see [insert good resource here]
This could save some time for those upgrading to Django 1.5.
Change History (9)
comment:1 by , 13 years ago
| Owner: | changed from to |
|---|
comment:2 by , 13 years ago
| Has patch: | set |
|---|
comment:3 by , 13 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|---|
| Type: | Uncategorized → Cleanup/optimization |
I guess we should capitalize "url" but other than that this looks good to me.
comment:4 by , 13 years ago
| Needs tests: | set |
|---|---|
| Triage Stage: | Ready for checkin → Accepted |
I'm going to add a test and commit this patch.
comment:5 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Pull request: https://github.com/django/django/pull/530