Oh no I made a crash bug and it somehow got past adding an account on live but not on test

This commit is contained in:
Zergling_man 2022-05-28 23:25:59 +10:00
parent 409ad95c05
commit 743d6ec5ca

View File

@ -7,7 +7,7 @@ class BankAccount(models.Model):
physical=models.CharField(max_length=100) physical=models.CharField(max_length=100)
currency=models.CharField(max_length=5) currency=models.CharField(max_length=5)
@property @property
def balance(self): return sum(map(Payment.objects.filter(account=self))) def balance(self): return sum(map(lambda x:x.amount,Payment.objects.filter(account=self)))
def __str__(self): def __str__(self):
return str(self.name)+', '+str(self.balance) return str(self.name)+', '+str(self.balance)