From 6fde9f984b63b0f1e29d2fc0a58c650c75bbc0c8 Mon Sep 17 00:00:00 2001 From: Maxime Pommier Date: Mon, 20 May 2019 10:05:31 +0200 Subject: [PATCH] =?UTF-8?q?[societegenerale]=C2=A0Handle=20the=20fact=20th?= =?UTF-8?q?at=20some=20loans=20doesn't=20show=20their=20history=20yet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/societegenerale/pages/accounts_list.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/societegenerale/pages/accounts_list.py b/modules/societegenerale/pages/accounts_list.py index fede0ea644..d1aa6a519d 100644 --- a/modules/societegenerale/pages/accounts_list.py +++ b/modules/societegenerale/pages/accounts_list.py @@ -68,9 +68,10 @@ def on_load(self): conditions = ( 'pas encore géré' in reason, # this page is not handled by SG api website - 'le service est momentanement indisponible' in reason, # can't access new website + 'le service est momentanement indisponible' in reason, # can't access new website ) assert any(conditions), 'Error %s is not handled yet' % reason + self.logger.warning('Handled Error "%s"', reason) class AccountsMainPage(LoggedPage, HTMLPage): @@ -465,6 +466,11 @@ def hist_pagination(self, condition): @pagination @method class iter_history(DictElement): + def condition(self): + # If we reach this point and it's "NOK", that's mean it's a known error handled + # in JsonBasePage and we can't have history for now. + return Dict('commun/statut')(self.el).upper() != 'NOK' + def next_page(self): return self.page.hist_pagination('history') @@ -512,6 +518,11 @@ def condition(self): @pagination @method class iter_intraday_comings(DictElement): + def condition(self): + # If we reach this point and it's "NOK", that mean it's a known error handled + # in JsonBasePage and we can't have history for now. + return Dict('commun/statut')(self.el).upper() != 'NOK' + def next_page(self): return self.page.hist_pagination('intraday') -- GitLab