#36182: querystring templatetag should render empty querystring as "?" not ""
when
it has removed items from the querydict
-------------------------------------+-------------------------------------
Reporter: David Feeley | Owner: (none)
Type: Bug | Status: new
Component: Template system | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: querystring | Triage Stage: Accepted
templatetag |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by David Feeley):
Replying to [comment:3 Sarah Boyce]:
> > {% querystring %}
> >
> > Outputs the current query string verbatim. So if the query string is
?color=green, the output would be ?color=green.
>
> I guess specifically, I did not expect the test
`template_tests.syntax_tests.test_querystring.QueryStringTagTests.test_querystring_empty_get_params`
to now return `"?"` instead of `""`. But perhaps there's no real advantage
of keeping the url the same?
I like your addition of the has_removed condition as I think rewriting an
empty query string ("") to "?" more generally probably violates the
principle of least surprise -- ie. why rewrite it when there is no need
to.
--
Ticket URL: <https://code.djangoproject.com/ticket/36182#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070194f5ea82c2-57020be8-4090-4f62-ba75-3a55919e642b-000000%40eu-central-1.amazonses.com.