#5270 closed (fixed)
Template tags won't accept an empty string as an argument
Reported by: | stephen | Owned by: | Jeremy Dunck |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Keywords: | empty string tplrf-fixed | |
Cc: | jdunck@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There currently appears to be no easy to pass an empty string to a template tag.
{% url admin "" %} results in a TemplateSyntaxError.
Some template tags (notable reverse URL lookups for the root of a newforms-admin instance) require an empty string to be passed in.
Attachments (2)
Change History (12)
comment:1 Changed 16 years ago by
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 Changed 16 years ago by
Changed 15 years ago by
Attachment: | empty-string.patch added |
---|
Patch to allow empty constant strings as filter arguments
comment:3 Changed 15 years ago by
Has patch: | set |
---|---|
Owner: | changed from nobody to Rowan Nairn |
Status: | new → assigned |
Added a patch
comment:4 Changed 15 years ago by
Keywords: | tplrf-fixed added |
---|
This would be fixed by the refactoring proposed in #7806.
comment:5 Changed 15 years ago by
milestone: | → 1.0 |
---|
Changed 15 years ago by
Attachment: | 5270-empty-string-template-w-tests.diff added |
---|
Added tests, and now handling the empty i18n constant specially for translation.
comment:6 Changed 15 years ago by
Cc: | jdunck@… added |
---|---|
Triage Stage: | Design decision needed → Ready for checkin |
comment:7 Changed 15 years ago by
Owner: | changed from Rowan Nairn to Jeremy Dunck |
---|---|
Status: | assigned → new |
comment:8 Changed 15 years ago by
Status: | new → assigned |
---|
comment:9 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
This is due to
in FilterExpression.init(), where the elif-clause should probably check for is None.
Would be nice if this could be fixed.