mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31219 -- Fixed object deletion crash for nested protected related objects.
This commit is contained in:
committed by
Mariusz Felisiak
parent
8c0c0235b6
commit
4e8d89020c
@@ -296,10 +296,7 @@ class Collector:
|
||||
try:
|
||||
field.remote_field.on_delete(self, field, sub_objs, self.using)
|
||||
except ProtectedError as error:
|
||||
key = "'%s.%s'" % (
|
||||
error.protected_objects[0].__class__.__name__,
|
||||
field.name,
|
||||
)
|
||||
key = "'%s.%s'" % (field.model.__name__, field.name)
|
||||
protected_objects[key] += error.protected_objects
|
||||
if protected_objects:
|
||||
raise ProtectedError(
|
||||
|
||||
Reference in New Issue
Block a user