summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Kestenholz <mk@feinheit.ch>2024-08-07 23:10:49 +0200
committerGitHub <noreply@github.com>2024-08-07 18:10:49 -0300
commit54888408a1e5552d9a42584550bda2355ed45943 (patch)
tree89eaf496050da022a73ba0af4a96f6148c993e49
parent790f0f8868b0cde9a9bec1f0621efa53b00c87df (diff)
Fixed #35639 -- Improved admin's delete confirmation page title.
-rw-r--r--django/contrib/admin/actions.py2
-rw-r--r--django/contrib/admin/options.py2
-rw-r--r--tests/admin_views/test_actions.py1
-rw-r--r--tests/admin_views/tests.py1
4 files changed, 4 insertions, 2 deletions
diff --git a/django/contrib/admin/actions.py b/django/contrib/admin/actions.py
index eefb63837e..865c16aff2 100644
--- a/django/contrib/admin/actions.py
+++ b/django/contrib/admin/actions.py
@@ -61,7 +61,7 @@ def delete_selected(modeladmin, request, queryset):
if perms_needed or protected:
title = _("Cannot delete %(name)s") % {"name": objects_name}
else:
- title = _("Are you sure?")
+ title = _("Delete multiple objects")
context = {
**modeladmin.admin_site.each_context(request),
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 2257b3072e..6d5c0708a3 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -2229,7 +2229,7 @@ class ModelAdmin(BaseModelAdmin):
if perms_needed or protected:
title = _("Cannot delete %(name)s") % {"name": object_name}
else:
- title = _("Are you sure?")
+ title = _("Delete")
context = {
**self.admin_site.each_context(request),
diff --git a/tests/admin_views/test_actions.py b/tests/admin_views/test_actions.py
index 8e1fc144e4..467fe046ef 100644
--- a/tests/admin_views/test_actions.py
+++ b/tests/admin_views/test_actions.py
@@ -72,6 +72,7 @@ class AdminActionsTest(TestCase):
self.assertContains(
confirmation, "Are you sure you want to delete the selected subscribers?"
)
+ self.assertContains(confirmation, "<h1>Delete multiple objects</h1>")
self.assertContains(confirmation, "<h2>Summary</h2>")
self.assertContains(confirmation, "<li>Subscribers: 2</li>")
self.assertContains(confirmation, "<li>External subscribers: 1</li>")
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index e0a4926b91..9dbe1e1432 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -3003,6 +3003,7 @@ class AdminViewPermissionsTest(TestCase):
response = self.client.get(
reverse("admin:admin_views_section_delete", args=(self.s1.pk,))
)
+ self.assertContains(response, "<h1>Delete</h1>")
self.assertContains(response, "<h2>Summary</h2>")
self.assertContains(response, "<li>Articles: 3</li>")
# test response contains link to related Article