Opened 18 years ago
Closed 18 years ago
#3543 closed (fixed)
url template tag gives no error if keyword arguments contain spaces
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Keywords: | url tag urlresolvers space | |
Cc: | 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
I was stuck for a while using the url template tag with keyword arguments. The problem was I had a space after the comma delimiting the arguments, something like:
{% url test.views.check_location country=address.country, city=address.city %} # bad
{% url test.views.check_location country=address.country,city=address.city %} # good
The space caused MatchChecker to look for a keyword parameter named ' city' (i.e. with leading space). The pattern didn't match, so I got nothing. I think an exception might be more helpful, so here's a patch in case you agree. :)
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | url-tag-spaces.diff added |
---|
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
Thanks Scott.
Personally I'd prefer it if the arguments weren't comma separated but rather space separated (like most other tags we have), but that's a different issue altogether ;)
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch to defaulttags and test