From 1bca3c79c5cfcea424bf07d9fdee655173f334c1 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Thu, 21 Feb 2019 18:46:24 +0100 Subject: [PATCH] [cragr] Avoid crash when redirection to Predica for old website MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes during the iter_history on the old Crédit Agricole website, we get this immediate: "AttributeError: 'PredicaRedirectPage' object has no attribute 'order_transactions'" This occurs when we try to call order_transactions whereas we are on the Predica space, which we don't handle yet. Since all regions will switch to the new website soon we will not build transactions for the Predica space from the old website. Closes: 13242@sibi --- modules/cragr/web/browser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/cragr/web/browser.py b/modules/cragr/web/browser.py index 01f9c52625..3f8f8ab716 100644 --- a/modules/cragr/web/browser.py +++ b/modules/cragr/web/browser.py @@ -460,6 +460,9 @@ def get_history(self, account, coming=False): date_guesser = LinearDateGuesser(date_max_bump=timedelta(2)) else: date_guesser = LinearDateGuesser() + if self.predica_redirect.is_here(): + self.logger.warning('Predica transactions are not handled.') + return self.page.order_transactions() while True: assert self.transactions.is_here() -- GitLab