From 20bf3205027fe581b8f33cd98b164f16a801c813 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 4 Mar 2015 12:00:12 -0500 Subject: [PATCH] [1.8.x] Fixed #24426 -- Displayed admin actions panel when show_full_result_count=False. Backport of 36a17be9f3cf6081f7e6f83fcfeae3d09ce8a72b from master --- django/contrib/admin/views/main.py | 2 +- tests/admin_views/tests.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index fa91ceae3a..c0e59f9a5f 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -203,7 +203,7 @@ class ChangeList(object): self.show_full_result_count = self.model_admin.show_full_result_count # 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 = self.show_full_result_count or bool(full_result_count) + self.show_admin_actions = not self.show_full_result_count or bool(full_result_count) self.full_result_count = full_result_count self.result_list = result_list self.can_show_all = can_show_all diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index e05a2598b5..6425cb21df 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -2655,6 +2655,7 @@ class AdminSearchTest(TestCase): self.assertContains(response, """1 result (Show all)""", html=True) + self.assertTrue(response.context['cl'].show_admin_actions) @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),