1
0
mirror of https://github.com/django/django.git synced 2024-12-22 09:05:43 +00:00

Fixed #35639 -- Improved admin's delete confirmation page title.

This commit is contained in:
Matthias Kestenholz 2024-08-07 23:10:49 +02:00 committed by GitHub
parent 790f0f8868
commit 54888408a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 2 deletions

View File

@ -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),

View File

@ -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),

View File

@ -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>")

View File

@ -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