#12068 closed (fixed)
The {% url %} parser can fail with StopIteration
| Reported by: | Johannes Dollinger | Owned by: | Stefan Moluf | 
|---|---|---|---|
| Component: | Template system | Version: | 1.1 | 
| Severity: | Keywords: | url tag | |
| Cc: | Triage Stage: | Design decision needed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
>>> Template("{% url view as %}") ... File "/django/template/defaulttags.py", line 1122, in url asvar = bits.next() StopIteration
This should either work (variables may be named as) or fail with TemplateSyntaxError.
Attachments (1)
Change History (9)
comment:1 by , 16 years ago
| milestone: | → 1.2 | 
|---|---|
| Triage Stage: | Unreviewed → Accepted | 
comment:2 by , 16 years ago
comment:3 by , 16 years ago
| Owner: | changed from to | 
|---|
comment:4 by , 16 years ago
| Triage Stage: | Accepted → Design decision needed | 
|---|
We currently disallow {% url view as %}, but accept {{ as }}. Should there be some consistency twixt the two?
Indeed, should any attempt to pass a keyword-named variable into a Context throw some error?
comment:6 by , 16 years ago
| milestone: | 1.2 → 1.3 | 
|---|
This is enough of an edge case that I'm comfortable punting it from 1.2.
comment:7 by , 15 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
This is fixed on 1.2.x and trunk, probably for a while now.
  Note:
 See   TracTickets
 for help on using tickets.
    
See also #12069