do not try to get IBAN from life insurance accounts

This commit is contained in:
Romain Bignon 2015-02-24 18:55:11 +01:00
commit e4b80bda90

View file

@ -30,7 +30,8 @@ class AccountsList(Page):
1: Account.TYPE_CHECKING,
2: Account.TYPE_SAVINGS,
3: Account.TYPE_DEPOSIT,
5: Account.TYPE_MARKET, # FIX ME : I don't know the right code
5: Account.TYPE_LIFE_INSURANCE,
8: Account.TYPE_LOAN,
9: Account.TYPE_LOAN,
}
@ -51,7 +52,7 @@ class AccountsList(Page):
account.balance = Decimal(str(compte['soldeDispo']))
account.coming = Decimal(str(compte['soldeAVenir']))
account.type = self.ACCOUNT_TYPES.get(id_famille, Account.TYPE_UNKNOWN)
account.id = 0
account.id = None
account._link_id = 'KEY'+compte['key']
# IBAN aren't in JSON
@ -60,8 +61,13 @@ class AccountsList(Page):
if a.label == account.label:
account.id = i
# But it's doesn't work with LOAN and MARKET, so use slow method : Get it from transaction page.
if account.id == 0:
account.id = self.browser.get_IBAN_from_account(account)
if account.id is None:
if account.type != Account.TYPE_LIFE_INSURANCE:
self.logger.debug('Get IBAN for account %s', account.label)
account.id = self.browser.get_IBAN_from_account(account)
else:
account.id = compte['value']
l.append(account)
if len(l) == 0: