Update __str__ functions
This commit is contained in:
parent
4792388ccd
commit
492e6e77d1
1 changed files with 2 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue