From aa794ab035ccddd356da62fe853dfa9158be6864 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Thu, 26 Feb 2015 14:48:18 +0100 Subject: [PATCH] do not try to get history of life insurance accounts --- modules/hellobank/browser.py | 8 ++------ modules/hellobank/perso/accounts_list.py | 7 +++++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/hellobank/browser.py b/modules/hellobank/browser.py index df715ed0..57fb206c 100644 --- a/modules/hellobank/browser.py +++ b/modules/hellobank/browser.py @@ -109,7 +109,7 @@ class HelloBank(Browser): def go_to_history_page(self,account): if account._link_id is None: - return iter([]) + raise NotImplementedError() if not self.is_on_page(AccountsList): self.location('/NSFR?Action=DSP_VGLOBALE') @@ -127,11 +127,9 @@ class HelloBank(Browser): } self.location('/udc', urllib.urlencode(data)) - return None - def go_to_coming_operations_page(self,account): if account._link_id is None: - return iter([]) + raise NotImplementedError() if not self.is_on_page(AccountsList): self.location('/NSFR?Action=DSP_VGLOBALE') @@ -149,8 +147,6 @@ class HelloBank(Browser): } self.location('/udc', urllib.urlencode(data)) - return None - def iter_history(self, account): self.go_to_history_page(account) return self.page.iter_operations() diff --git a/modules/hellobank/perso/accounts_list.py b/modules/hellobank/perso/accounts_list.py index 33295613..7e37a25e 100644 --- a/modules/hellobank/perso/accounts_list.py +++ b/modules/hellobank/perso/accounts_list.py @@ -53,7 +53,10 @@ class AccountsList(Page): account.coming = Decimal(str(compte['soldeAVenir'])) account.type = self.ACCOUNT_TYPES.get(id_famille, Account.TYPE_UNKNOWN) 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 # Fast method, get it from transfer page. @@ -62,7 +65,7 @@ class AccountsList(Page): 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 is None: - if account.type != Account.TYPE_LIFE_INSURANCE: + if account._link_id: self.logger.debug('Get IBAN for account %s', account.label) account.id = self.browser.get_IBAN_from_account(account) else: