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:
parent
790f0f8868
commit
54888408a1
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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>")
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user