From eea724566448afd3f40b13e81d6bba96f4768c26 Mon Sep 17 00:00:00 2001 From: Baptiste Delpey Date: Fri, 28 Dec 2018 15:46:38 +0100 Subject: [PATCH] [caissedepargne] throw ActionNeeded if login uncessfull multiple times --- modules/caissedepargne/browser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/caissedepargne/browser.py b/modules/caissedepargne/browser.py index 522af54021..eae03e34b1 100644 --- a/modules/caissedepargne/browser.py +++ b/modules/caissedepargne/browser.py @@ -33,7 +33,9 @@ from weboob.capabilities.base import NotAvailable from weboob.capabilities.profile import Profile from weboob.browser.exceptions import BrowserHTTPNotFound, ClientError -from weboob.exceptions import BrowserIncorrectPassword, BrowserUnavailable, BrowserHTTPError, BrowserPasswordExpired +from weboob.exceptions import ( + BrowserIncorrectPassword, BrowserUnavailable, BrowserHTTPError, BrowserPasswordExpired, ActionNeeded +) from weboob.tools.capabilities.bank.transactions import sorted_transactions, FrenchTransaction from weboob.tools.capabilities.bank.investments import create_french_liquidity from weboob.tools.compat import urljoin @@ -309,6 +311,11 @@ def do_login(self): # the only possible way to log in w/o nuser is on WE. if we're here no need to go further. if not self.nuser and self.typeAccount == 'WE': raise BrowserIncorrectPassword(response['error']) + + # we tested all, next iteration will throw the assertion + if self.inexttype == len(accounts_types) and 'Temporairement votre abonnement est bloqué' in response['error']: + raise ActionNeeded(response['error']) + if self.multi_type: # try to log in with the next connection type's value self.do_login() -- GitLab