Fix create snapshot bug

This commit is contained in:
Edgar P. Burkhart 2022-12-30 18:22:27 +01:00
parent 9ea0839ba8
commit bae4fed8d6
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
1 changed files with 4 additions and 3 deletions

View File

@ -146,9 +146,10 @@ class Snapshot(AccountModel):
)
def __str__(self):
return "{} {}".format(
_("%(date)s statement") % {"date": self.date}, self.account
)
desc = _("%(date)s statement") % {"date": self.date}
if hasattr(self, "account"):
return f"{desc} {self.account}"
return desc
def save(self, *args, **kwargs):
if Snapshot.objects.filter(id=self.id).exists():