Opened 12 years ago
Closed 12 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_querysetthat 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_querysetmethod.
Test an fix attached. Tests are probably in the wrong place and need to be moved.
Attachments (1)
Change History (8)
by , 12 years ago
| Attachment: | admin-history-get_queryset-1.diff added |
|---|
comment:1 by , 12 years ago
| Component: | Uncategorized → contrib.admin |
|---|---|
| Has patch: | set |
| Patch needs improvement: | set |
comment:2 by , 12 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:4 by , 12 years ago
comment:5 by , 12 years ago
| Triage Stage: | Accepted → Ready 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 12 years ago by (next)
comment:6 by , 12 years ago
| Cc: | added |
|---|
comment:7 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
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.