Add transaction handling in more places
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -250,9 +250,12 @@ class DocumentVersion(models.Model):
|
||||
self.document, self
|
||||
)
|
||||
|
||||
event_document_version_revert.commit(actor=_user, target=self.document)
|
||||
for version in self.document.versions.filter(timestamp__gt=self.timestamp):
|
||||
version.delete()
|
||||
with transaction.atomic():
|
||||
event_document_version_revert.commit(
|
||||
actor=_user, target=self.document
|
||||
)
|
||||
for version in self.document.versions.filter(timestamp__gt=self.timestamp):
|
||||
version.delete()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user