From f190053e84eec255ca7cb5575b742d05687423fa Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 12 Sep 2020 18:36:05 +0200 Subject: [PATCH] Display the right amount in soge credit detail --- apps/treasury/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/treasury/models.py b/apps/treasury/models.py index d611650f..d5a8bb6b 100644 --- a/apps/treasury/models.py +++ b/apps/treasury/models.py @@ -295,7 +295,8 @@ class SogeCredit(models.Model): @property def amount(self): - return sum(transaction.total for transaction in self.transactions.all()) + 8000 + return self.credit_transaction.total if self.valid \ + else sum(transaction.total for transaction in self.transactions.all()) + 8000 def invalidate(self): """