From 492e6e77d162901ff7bd618d43ab6af07289fe73 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Thu, 20 Apr 2023 09:23:30 +0200 Subject: [PATCH] Update __str__ functions --- nummi/main/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nummi/main/models.py b/nummi/main/models.py index 3b0ed62..d967eda 100644 --- a/nummi/main/models.py +++ b/nummi/main/models.py @@ -153,7 +153,7 @@ class Snapshot(AccountModel): def __str__(self): desc = _("%(date)s statement") % {"date": self.date} if hasattr(self, "account"): - return f"{desc} – {self.account}" + return f"{desc} – {self.account}" return desc def save(self, *args, **kwargs): @@ -243,7 +243,7 @@ class Transaction(NummiModel): self.snapshot.update_sum() def __str__(self): - return f"{self.date} – {self.name}" + return f"{self.name}" def get_absolute_url(self): return reverse("transaction", kwargs={"pk": self.pk}) @@ -288,8 +288,6 @@ class Invoice(NummiModel): super().save(*args, **kwargs) def __str__(self): - if hasattr(self, "transaction"): - return str(format_lazy("{} – {}", self.name, self.transaction.name)) return str(self.name) def delete(self, *args, **kwargs):