diff --git a/modules/caissedepargne/browser.py b/modules/caissedepargne/browser.py index aaf7b33ca6c80e1708e432f880f44257f6fcda8d..60afd65065210361298778dd23065229d1868bb4 100644 --- a/modules/caissedepargne/browser.py +++ b/modules/caissedepargne/browser.py @@ -450,9 +450,13 @@ def get_accounts_list(self): if self.cards.is_here(): for card in cards: info = card.parent._card_links - self.page.go_list() - self.page.go_history(info) - card._coming_info = self.page.get_card_coming_info(card.number, info.copy()) + + # If info is filled, that mean there are comings transaction + card._coming_info = None + if info: + self.page.go_list() + self.page.go_history(info) + card._coming_info = self.page.get_card_coming_info(card.number, info.copy()) self.accounts.extend(cards) @@ -528,7 +532,7 @@ def _get_history(self, info, account_card=None): # In this case, we want the coming transaction for the new website # (old website return coming directly in `get_coming()` ) - if account_card and info['type'] == 'HISTORIQUE_CB': + if account_card and info and info['type'] == 'HISTORIQUE_CB': self.page.go_coming(account_card._coming_info['link']) info['link'] = [info['link']] @@ -688,9 +692,11 @@ def get_coming(self, account): # We are on the new website. info = account.parent._card_links - for tr in self._get_history(info.copy(), account): - tr.type = tr.TYPE_DEFERRED_CARD - trs.append(tr) + # if info is empty, that mean there are no coming yet + if info: + for tr in self._get_history(info.copy(), account): + tr.type = tr.TYPE_DEFERRED_CARD + trs.append(tr) return sorted_transactions(trs)