Opened 3 years ago

Closed 3 years ago

#22396 closed Bug (needsinfo)

Admin AllValuesFieldListFilter not respecting ModelAdmin.get_queryset

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


Admin's AllValuesFieldListFilter object does not respect ModelAdmin.get_queryset. Instead it mysteriously calls reverse_field_path() method and uses the _default_manager to get the queryset.

It causes problems when the default database has no table for the model, and only the other databases has the table. It causes "Table not found" query error message.

Pull request:

Change History (2)

comment:1 Changed 3 years ago by Tim Graham

Easy pickings: unset

Could you add a test to demonstrate the problem?

comment:2 Changed 3 years ago by Tim Graham

Resolution: needsinfo
Status: newclosed

The proposed patch breaks some admin_view tests. Please reopen if you can provide more details and a patch that doesn't break tests. Thanks!

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