diff --git a/django/contrib/admin/actions.py b/django/contrib/admin/actions.py index 80b0ac83d6c79..6fdf070694277 100644 --- a/django/contrib/admin/actions.py +++ b/django/contrib/admin/actions.py @@ -38,7 +38,7 @@ def delete_selected(modeladmin, request, queryset): # The user has already confirmed the deletion. # Do the deletion and return a None to display the change list view again. - if request.POST.get('post'): + if request.POST.get('post') and not protected: if perms_needed: raise PermissionDenied n = queryset.count() diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 4802827a5c436..ed71d6da46efb 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -3156,6 +3156,22 @@ def test_model_admin_default_delete_action_no_change_url(self): # The page shouldn't display a link to the nonexistent change page self.assertContains(response, "