Fixed race condition on multiple attachment deletion

remotes/origin/issue/4795/notification_even_they_are_disabled
Jesús Espino 2016-07-26 13:23:27 +02:00 committed by David Barragán Merino
parent 340bc7670b
commit 0a900cc84d
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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)