From 0419556b1bc70e7b8d905a854f130a40f8f57dd5 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Thu, 25 Jul 2013 15:26:43 +0200 Subject: [PATCH] ignore accounts without balance --- modules/cragr/web/pages.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/cragr/web/pages.py b/modules/cragr/web/pages.py index 5ae3c210..a151a44b 100644 --- a/modules/cragr/web/pages.py +++ b/modules/cragr/web/pages.py @@ -86,7 +86,12 @@ class _AccountsPage(BasePage): account = Account() account.id = self.parser.tocleanstring(cols[self.COL_ID]) account.label = self.parser.tocleanstring(cols[self.COL_LABEL]) - account.balance = Decimal(Transaction.clean_amount(self.parser.tocleanstring(cols[self.COL_VALUE]))) + balance = self.parser.tocleanstring(cols[self.COL_VALUE]) + # we have to ignore those accounts, because using NotAvailable + # makes boobank and probably many others crash + if balance == 'indisponible': + continue + account.balance = Decimal(Transaction.clean_amount(balance)) account.currency = account.get_currency(self.parser.tocleanstring(cols[self.COL_CURRENCY])) account._link = None