Fixed race condition on multiple attachment deletion
parent
340bc7670b
commit
0a900cc84d
|
@ -74,7 +74,7 @@ class BaseAttachmentViewSet(HistoryResourceMixin, WatchedResourceMixin,
|
|||
# NOTE: When destroy an attachment, the content_object change
|
||||
# after and not before
|
||||
self.persist_history_snapshot(obj, delete=True)
|
||||
super().pre_delete(obj)
|
||||
super().post_delete(obj)
|
||||
|
||||
def get_object_for_snapshot(self, obj):
|
||||
return obj.content_object
|
||||
|
|
|
@ -62,7 +62,7 @@ class HistoryResourceMixin(object):
|
|||
obj = self.get_object()
|
||||
|
||||
sobj = self.get_object_for_snapshot(obj)
|
||||
if sobj != obj and delete:
|
||||
if sobj != obj:
|
||||
delete = False
|
||||
|
||||
notifications_services.analize_object_for_watchers(obj, comment, user)
|
||||
|
|
Loading…
Reference in New Issue