From caa84dbf2cfc39c1633cb934cb58e12707fd7691 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Wed, 24 Jul 2013 13:33:07 +0200 Subject: [PATCH] bnporc[ent]: Ignore "not available" accounts --- modules/bnporc/enterprise/pages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/bnporc/enterprise/pages.py b/modules/bnporc/enterprise/pages.py index 3dbafa31..d8040d70 100644 --- a/modules/bnporc/enterprise/pages.py +++ b/modules/bnporc/enterprise/pages.py @@ -139,6 +139,10 @@ class AccountsPage(BEPage): account.id = to_unicode(tdid.text.strip().replace(' ', '')) # just in case we are showing the converted balances account._main_currency = Account.get_currency(tdcur.text) + # we have to ignore those accounts, because using NotAvailable + # makes boobank and probably many others crash + if tdbal.text_content().strip() == 'indisponible': + continue account.balance = Decimal(Transaction.clean_amount(tdbal.text_content())) account.currency = Account.get_currency(tdbalcur.text) account._updated = datetime.strptime(tdupdated.text, '%d/%m/%Y')