Opened 11 years ago
Closed 11 years ago
#21063 closed Cleanup/optimization (fixed)
AdminSite app_index does work it doesn't need to
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
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 |
Description
If a user doesn't have permissions to a module (as defined by it's app label), the way the app_index works, it will still go through the motions of iterating the modeladmin registry and checking permissions it knows cannot be true, as far as I can see. Having done all that, if the app_dict
is empty [and it should be], it throws a 404, whereas the ModelAdmin views themselves tend to raise PermissionDenied. The fix is pretty simple, and actually simplifies the view, if you believe shallow trumps deep.
Marking as has patch on the basis on an incoming GitHub pull request.
Change History (2)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Pull request is here, tests pass locally based on the following command: