From 743d6ec5cadfa95660aafb84b972213574d0889a Mon Sep 17 00:00:00 2001 From: Zergling_man Date: Sat, 28 May 2022 23:25:59 +1000 Subject: [PATCH] Oh no I made a crash bug and it somehow got past adding an account on live but not on test --- nerdshope/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerdshope/models.py b/nerdshope/models.py index 160dfc3..972f1f8 100644 --- a/nerdshope/models.py +++ b/nerdshope/models.py @@ -7,7 +7,7 @@ class BankAccount(models.Model): physical=models.CharField(max_length=100) currency=models.CharField(max_length=5) @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): return str(self.name)+', '+str(self.balance)