Short description
BulkDeletingView.post() calls .delete() on objects one by one inside a loop without wrapping in a transaction. If the 51st item raises ProtectedError, the first 50 are already gone with no rollback.
Suggested Solution
# Fix: add @transaction.atomic to post(), or wrap the loop
with transaction.atomic():
for content_object in self.get_queryset():
...
content_object.delete()
Short description
BulkDeletingView.post()calls.delete()on objects one by one inside a loop without wrapping in a transaction. If the 51st item raisesProtectedError, the first 50 are already gone with no rollback.Suggested Solution