diff --git a/modules/boursorama/browser.py b/modules/boursorama/browser.py index 6dae69f40aa7cde54aaeb3a8f288ba75f63b0b5a..0c8e2153a31d671bcc9f073f1b8fb0f93933073e 100644 --- a/modules/boursorama/browser.py +++ b/modules/boursorama/browser.py @@ -163,18 +163,13 @@ def load_state(self, state): def handle_authentication(self): if self.authentication.is_here(): self.check_interactive() - if self.config['enable_twofactors'].get(): - confirmation_link = self.page.get_confirmation_link() - if confirmation_link: - self.location(confirmation_link) - self.page.sms_first_step() - self.page.sms_second_step() - else: - raise BrowserIncorrectAuthenticationCode( - """Boursorama - activate the two factor authentication in boursorama config.""" - """ You will receive SMS code but are limited in request per day (around 15)""" - ) + confirmation_link = self.page.get_confirmation_link() + if confirmation_link: + self.location(confirmation_link) + + self.page.sms_first_step() + self.page.sms_second_step() def handle_sms(self): # regular 2FA way @@ -192,8 +187,6 @@ def handle_sms(self): raise BrowserIncorrectAuthenticationCode() def init_login(self): - assert isinstance(self.config['device'].get(), basestring) - assert isinstance(self.config['enable_twofactors'].get(), bool) if not self.password.isalnum(): raise BrowserIncorrectPassword() diff --git a/modules/boursorama/module.py b/modules/boursorama/module.py index 2f60e3b77c348e1a5dca745e62a8e9020b8b8f9e..fd32d9aadf24de38a129fa107e49e92f7c057410 100644 --- a/modules/boursorama/module.py +++ b/modules/boursorama/module.py @@ -28,7 +28,7 @@ from weboob.capabilities.profile import CapProfile from weboob.capabilities.contact import CapContact from weboob.tools.backend import Module, BackendConfig -from weboob.tools.value import ValueBackendPassword, ValueBool, Value +from weboob.tools.value import ValueBackendPassword, ValueTransient from .browser import BoursoramaBrowser @@ -45,10 +45,8 @@ class BoursoramaModule(Module, CapBankWealth, CapBankTransferAddRecipient, CapPr DESCRIPTION = u'Boursorama' CONFIG = BackendConfig(ValueBackendPassword('login', label='Identifiant', masked=False), ValueBackendPassword('password', label='Mot de passe'), - ValueBool('enable_twofactors', label='Send validation sms', default=False), - Value('device', label='Device name', regexp='\w*', default='weboob'), - Value('pin_code', label='Sms code', required=False, default=''), - Value('request_information', default=None, noprompt=True, required=False), + ValueTransient('pin_code'), + ValueTransient('request_information'), ) BROWSER = BoursoramaBrowser diff --git a/modules/boursorama/pages.py b/modules/boursorama/pages.py index 744dbca0554ddf9ca20ae58fc9297971a8ffc3f0..324c0d4fcebbd8fd4b54e783dec8dfd24e3632b1 100644 --- a/modules/boursorama/pages.py +++ b/modules/boursorama/pages.py @@ -52,10 +52,6 @@ from weboob.exceptions import BrowserQuestion, BrowserIncorrectPassword, BrowserHTTPNotFound, BrowserUnavailable, ActionNeeded -class BrowserAuthenticationCodeMaxLimit(BrowserIncorrectPassword): - pass - - class IncidentPage(HTMLPage): pass @@ -89,8 +85,6 @@ def sms_first_step(self): """ This function simulates the registration of a device on boursorama two factor authentification web page. - @param device device name to register - @exception BrowserAuthenticationCodeMaxLimit when daily limit is consumed """ form = self.get_form() form.submit()