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, 1: Account.TYPE_CHECKING,
2: Account.TYPE_SAVINGS, 2: Account.TYPE_SAVINGS,
3: Account.TYPE_DEPOSIT, 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, 9: Account.TYPE_LOAN,
} }
@ -51,7 +52,7 @@ class AccountsList(Page):
account.balance = Decimal(str(compte['soldeDispo'])) account.balance = Decimal(str(compte['soldeDispo']))
account.coming = Decimal(str(compte['soldeAVenir'])) account.coming = Decimal(str(compte['soldeAVenir']))
account.type = self.ACCOUNT_TYPES.get(id_famille, Account.TYPE_UNKNOWN) account.type = self.ACCOUNT_TYPES.get(id_famille, Account.TYPE_UNKNOWN)
account.id = 0 account.id = None
account._link_id = 'KEY'+compte['key'] account._link_id = 'KEY'+compte['key']
# IBAN aren't in JSON # IBAN aren't in JSON
@ -60,8 +61,13 @@ class AccountsList(Page):
if a.label == account.label: if a.label == account.label:
account.id = i account.id = i
# But it's doesn't work with LOAN and MARKET, so use slow method : Get it from transaction page. # But it's doesn't work with LOAN and MARKET, so use slow method : Get it from transaction page.
if account.id == 0: if account.id is None:
account.id = self.browser.get_IBAN_from_account(account) 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) l.append(account)
if len(l) == 0: if len(l) == 0: