1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Refs #34462 -- Fixed queryset antipattern when processing object deletion.

This commit is contained in:
nessita 2023-04-22 07:23:22 -03:00 committed by GitHub
parent 92537e83c1
commit 851b687956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ def delete_selected(modeladmin, request, queryset):
if request.POST.get("post") and not protected:
if perms_needed:
raise PermissionDenied
n = queryset.count()
n = len(queryset)
if n:
for obj in queryset:
obj_display = str(obj)