Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29219 closed Bug (fixed)

Admin Changelist Filters Not Using Parsed Params

Reported by: David Sanders Owned by: nobody
Component: contrib.admin Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Several of the admin changelist filter classes pull parameters directly from `request.GET` despite having a dict of parsed params passed in. I consider this a bug because it's a bit of a split-brain issue, some of the code works with the passed in params, some of it works directly with request.GET, so there's not one consistent place to change behavior regarding params. Specific use case I ran into: if you want a filter which 'expands' to providing values for multiple other filters, overriding ChangeList.get_filters_params would seem like the logical place to do the parameter expansion, but doing so yields inconsistent results due to the direct use of request.GET for pulling parameters in some filters but not others (specifically DateFieldListFilter and SimpleListFilter respond as you'd expect, other filters do not). Having the filters pull from the provided params closes this loop and makes things act consistently.

Change History (2)

comment:1 by Markus Holtermann, 6 years ago

Easy pickings: set
Last edited 6 years ago by Tim Graham (previous) (diff)

comment:2 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: newclosed

In 47bb3b68:

Fixed #29219 -- Made admin filters use processed params rather than request.GET.

Note: See TracTickets for help on using tickets.
Back to Top