#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.
PR