Fix bugs with snapshots: opening earliest snapshot, deleting latest

This commit is contained in:
Edgar P. Burkhart 2022-05-22 10:39:29 +02:00
parent 57ace376d8
commit 02b0fae3f7
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 7 additions and 4 deletions

View file

@ -121,7 +121,7 @@ class Snapshot(models.Model):
try:
_next = self.__class__.objects.get(previous=self)
except self.__class__.DoesNotExist:
pass
super().delete(*args, **kwargs)
else:
_next.previous = self.previous
super().delete(*args, **kwargs)