#36182: querystring templatetag should render empty querystring as "?" not ""
-------------------------------------+-------------------------------------
     Reporter:  David Feeley         |                     Type:  Bug
       Status:  new                  |                Component:  Template
                                     |  system
      Version:  5.1                  |                 Severity:  Normal
     Keywords:  querystring          |             Triage Stage:
  templatetag                        |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Hello,
 Consider 2 anchors that link to a filtered and unfiltered version of the
 current page via a GET param foo.

 {{{
 <a href="{% querystring foo=None %}">All Records</a>
 <a href="{% querystring foo=bar %}">Bar Records Only</a>
 }}}

 If the user is currently on the filtered page https://example.com/?foo=bar
 and clicks the first link, the querystring template tag, being empty, will
 render as "", which means href="" which the browser will interpret as
 reload the current (filtered) page.  I believe instead the templatetag
 should render this case as "?"

 [https://github.com/dfeeley/django/compare/main..empty-querystring]

 thanks
 Dave
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36182>
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/01070194f13b8a3e-0910db8c-6715-4a6b-b43a-c9c0a104a23d-000000%40eu-central-1.amazonses.com.

Reply via email to