From 678c0db18fe297ecad9e922c95d87030ff8e42c0 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Mon, 8 Jun 2020 10:32:26 +0200 Subject: [PATCH] [apivie] Remove code related to InfoPage This Action Needed is easily bypassed since now we are fecthing the accounts on the API. We still keep the Page class to handle the related URL after login. --- modules/apivie/browser.py | 11 ++--------- modules/apivie/pages.py | 3 +-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/modules/apivie/browser.py b/modules/apivie/browser.py index 6d5b6efc1a..e42bd8cfeb 100644 --- a/modules/apivie/browser.py +++ b/modules/apivie/browser.py @@ -25,7 +25,7 @@ from weboob.tools.decorators import retry from weboob.browser import LoginBrowser, URL, need_login -from weboob.exceptions import BrowserIncorrectPassword, ActionNeeded, BrowserUnavailable +from weboob.exceptions import BrowserIncorrectPassword, BrowserUnavailable from weboob.browser.exceptions import ClientError from .pages import ( @@ -44,7 +44,7 @@ class ApivieBrowser(LoginBrowser): LoginPage ) wrongpass = URL(r'/accueil.*saveLastPath=false', WrongpassPage) - info = URL(r'/coordonnees', r'/accueil-connect', InfoPage) + info = URL(r'/(coordonnees|accueil-connect)', InfoPage) home = URL(r'/contrats-cosy3', HomePage) accounts = URL(r'https://(?P.*)/interne/contrat/', AccountsPage) investments = URL(r'https://(?P.*)/contrat/(?P\d+)$', InvestmentPage) @@ -62,13 +62,6 @@ def do_login(self): self.page.login(self.username, self.password) - # If the user's contact info is too old the website asks to verify them. - # We are logged but we cannot go further. - if self.info.is_here(): - error_message = self.page.get_error_message() - assert error_message, 'Error message location has changed on info page' - raise ActionNeeded(error_message) - if self.wrongpass.is_here(): raise BrowserIncorrectPassword() diff --git a/modules/apivie/pages.py b/modules/apivie/pages.py index ba64eb93be..034ec4db96 100644 --- a/modules/apivie/pages.py +++ b/modules/apivie/pages.py @@ -49,8 +49,7 @@ class WrongpassPage(HTMLPage): class InfoPage(LoggedPage, HTMLPage): - def get_error_message(self): - return CleanText('//span[@class="ui-messages-fatal-detail"]')(self.doc) + pass class HomePage(LoggedPage, HTMLPage): -- GitLab