From e188452b2be4b2132d4cbbf171ee373c41f80ce5 Mon Sep 17 00:00:00 2001 From: Jerome Berthier Date: Thu, 25 Apr 2019 17:07:33 +0200 Subject: [PATCH] [banquepopulaire] Add support for BrowserIncorrectPassword when there is a Virtual Keyboard According to the Banque Populaire Occitane IVR (05 81 22 00 00), users must change their passwords to continue to use the service. --- modules/banquepopulaire/pages.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/banquepopulaire/pages.py b/modules/banquepopulaire/pages.py index 298216b553..48f6811496 100644 --- a/modules/banquepopulaire/pages.py +++ b/modules/banquepopulaire/pages.py @@ -31,7 +31,7 @@ from weboob.browser.filters.standard import CleanText, CleanDecimal, Regexp, Eval, Date, Field from weboob.browser.filters.html import Attr, Link, AttributeNotFound from weboob.browser.filters.json import Dict -from weboob.exceptions import BrowserUnavailable, BrowserIncorrectPassword, ActionNeeded +from weboob.exceptions import BrowserUnavailable, BrowserIncorrectPassword, ActionNeeded, BrowserPasswordExpired from weboob.browser.pages import HTMLPage, LoggedPage, FormNotFound, JsonPage, RawPage, XMLPage @@ -386,8 +386,12 @@ def login(self, login, password): form_id = (k, v[0]['id'], v[0]['type']) if v[0].get('virtualKeyboard'): + if not password.isdigit(): + # Users who get virtualkeyboard must change their passwords + # If there are letters in the password it means they did not do it. + raise BrowserPasswordExpired() password = self.virtualkeyboard(vk_obj=v[0]['virtualKeyboard'], - password=password) + password=password) payload = { 'validate': { -- GitLab