Opened 11 years ago

Closed 11 years ago

#21013 closed Uncategorized (fixed)

Admin history should consider ModelAdmin.get_queryset

Reported by: Jonas H. Owned by: jcatalan
Component: contrib.admin Version: 1.5
Severity: Normal Keywords:
Cc: jonas-django@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

  • Model with custom default manager that excludes some objects
  • ModelAdmin with custom get_queryset that includes more objects than the manager
  • History view throws 404 for any objects that aren't included the default manager because it doesn't consider the ModelAdmin's get_queryset method.

Test an fix attached. Tests are probably in the wrong place and need to be moved.

Attachments (1)

admin-history-get_queryset-1.diff (5.0 KB ) - added by Jonas H. 11 years ago.

Download all attachments as: .zip

Change History (8)

by Jonas H., 11 years ago

comment:1 by Jonas H., 11 years ago

Component: Uncategorizedcontrib.admin
Has patch: set
Patch needs improvement: set

comment:2 by jcatalan, 11 years ago

Owner: changed from nobody to jcatalan
Status: newassigned

comment:3 by jcatalan, 11 years ago

Triage Stage: UnreviewedAccepted

comment:4 by jcatalan, 11 years ago

I've checked the test and the patch and everything seems to be right. I'll submit a PR and see if I can get some code review by a core dev.

comment:5 by jcatalan, 11 years ago

Triage Stage: AcceptedReady for checkin

I've submited a PR with your patch, so I'm changing this to Ready for checkin though I still have to check if the test case is well located or change it in case it's not.

Version 0, edited 11 years ago by jcatalan (next)

comment:6 by Jonas H., 11 years ago

Cc: jonas-django@… added

comment:7 by Julien Phalip <jphalip@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 04415bf81b2440a08fc224e6c481bcb5840bbcbc:

Fixed #21013 -- Ensure that ModelAdmin.get_queryset is considered for the admin history view.

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