#29121: Admin ChangeList trims off multi-valued query parameters
-------------------------------------+-------------------------------------
               Reporter:  Jeffrey    |          Owner:  nobody
  Bian                               |
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  master
  contrib.admin                      |       Keywords:  custom ChangeList
               Severity:  Normal     |  admin
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In contrib.admin.views.main module - ChangeList class constructor, when
 populating self.params with GET query parameters, it converts it into a
 single valued dict.
 E.g., for customized parameters like "tag=1&tag=10&tag=3", only one value
 will be preserved.

 
https://github.com/django/django/blob/master/django/contrib/admin/views/main.py#L66

 Suggested fix:

 Instead of calling request.GET.items(), usse request.GET.lists() so to
 preserve all values. Thus the line reads:


 {{{
 self.params = dict(request.GET.lists())
 }}}


 This will flatten the dict while making the multiple values of a key into
 a list.

 Patch below in attachment.

 Regards,

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29121>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.c8b916c87a46c8fa87aa6382f38c4302%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to