#33095: Admin actions shown with zero results
------------------------------------------------+------------------------
               Reporter:  Richard Laager        |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  contrib.admin         |        Version:  3.2
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 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)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33095>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.6245a93a33fc3314a3ed202de6489fe6%40djangoproject.com.

Reply via email to