do not try to get history of life insurance accounts

This commit is contained in:
Romain Bignon 2015-02-26 14:48:18 +01:00
commit aa794ab035
2 changed files with 7 additions and 8 deletions

View file

@ -109,7 +109,7 @@ class HelloBank(Browser):
def go_to_history_page(self,account): def go_to_history_page(self,account):
if account._link_id is None: if account._link_id is None:
return iter([]) raise NotImplementedError()
if not self.is_on_page(AccountsList): if not self.is_on_page(AccountsList):
self.location('/NSFR?Action=DSP_VGLOBALE') self.location('/NSFR?Action=DSP_VGLOBALE')
@ -127,11 +127,9 @@ class HelloBank(Browser):
} }
self.location('/udc', urllib.urlencode(data)) self.location('/udc', urllib.urlencode(data))
return None
def go_to_coming_operations_page(self,account): def go_to_coming_operations_page(self,account):
if account._link_id is None: if account._link_id is None:
return iter([]) raise NotImplementedError()
if not self.is_on_page(AccountsList): if not self.is_on_page(AccountsList):
self.location('/NSFR?Action=DSP_VGLOBALE') self.location('/NSFR?Action=DSP_VGLOBALE')
@ -149,8 +147,6 @@ class HelloBank(Browser):
} }
self.location('/udc', urllib.urlencode(data)) self.location('/udc', urllib.urlencode(data))
return None
def iter_history(self, account): def iter_history(self, account):
self.go_to_history_page(account) self.go_to_history_page(account)
return self.page.iter_operations() return self.page.iter_operations()

View file

@ -53,7 +53,10 @@ class AccountsList(Page):
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 = None account.id = None
account._link_id = 'KEY'+compte['key'] if account.type != Account.TYPE_LIFE_INSURANCE:
account._link_id = 'KEY'+compte['key']
else:
account._link_id = None
# IBAN aren't in JSON # IBAN aren't in JSON
# Fast method, get it from transfer page. # Fast method, get it from transfer page.
@ -62,7 +65,7 @@ class AccountsList(Page):
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 is None: if account.id is None:
if account.type != Account.TYPE_LIFE_INSURANCE: if account._link_id:
self.logger.debug('Get IBAN for account %s', account.label) self.logger.debug('Get IBAN for account %s', account.label)
account.id = self.browser.get_IBAN_from_account(account) account.id = self.browser.get_IBAN_from_account(account)
else: else: