Opened 3 years ago
Last modified 2 months ago
#33095 closed Cleanup/optimization
Admin actions shown with zero results — at Initial Version
Reported by: | Richard Laager | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Carlton Gibson | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
contrib/admin/views/main.py has this:
# Admin actions are shown if there is at least one entry # or if entries are not counted because show_full_result_count is disabled self.show_admin_actions = not self.show_full_result_count or bool(full_result_count)
This was changed in 17557d068c43bd61cdc6c18caf250ffa469414a1 for #8408.
Is it intentional that the admin actions be shown if there are any rows in the table as opposed to any results on the page? Put differently, if there are no results on the page, I can't do anything with the actions, right?
It seems like this should use result_count (which is the number of filtered results) rather than full_result_count (which is the number of rows in the table):
# Admin actions are shown if there is at least one entry self.show_admin_actions = bool(result_count)