LCL: deal with wrong login
Signed-off-by: Pierre Mazière <pierre.maziere@gmail.com> Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
parent
bafbf3644a
commit
78fe6e38f8
2 changed files with 9 additions and 5 deletions
|
|
@ -56,9 +56,8 @@ class LCLBrowser(BaseBrowser):
|
||||||
self.location('%s://%s/index.html' % (self.PROTOCOL, self.DOMAIN),\
|
self.location('%s://%s/index.html' % (self.PROTOCOL, self.DOMAIN),\
|
||||||
no_login=True)
|
no_login=True)
|
||||||
|
|
||||||
self.page.login(self.agency, self.username, self.password)
|
if not self.page.login(self.agency, self.username, self.password) or \
|
||||||
|
not self.is_logged() or \
|
||||||
if not self.is_logged() or \
|
|
||||||
(self.is_on_page(LoginResultPage) and self.page.is_error()) :
|
(self.is_on_page(LoginResultPage) and self.page.is_error()) :
|
||||||
raise BrowserIncorrectPassword()
|
raise BrowserIncorrectPassword()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from weboob.capabilities.bank import Operation
|
from weboob.capabilities.bank import Operation
|
||||||
from weboob.capabilities.bank import Account
|
from weboob.capabilities.bank import Account
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage, BrowserUnavailable
|
||||||
|
|
||||||
class LoginPage(BasePage):
|
class LoginPage(BasePage):
|
||||||
def login(self, agency, login, passwd):
|
def login(self, agency, login, passwd):
|
||||||
|
|
@ -27,7 +27,12 @@ class LoginPage(BasePage):
|
||||||
self.browser['agenceId'] = agency
|
self.browser['agenceId'] = agency
|
||||||
self.browser['compteId'] = login
|
self.browser['compteId'] = login
|
||||||
self.browser['CodeId'] = passwd
|
self.browser['CodeId'] = passwd
|
||||||
self.browser.submit()
|
try:
|
||||||
|
self.browser.submit()
|
||||||
|
except BrowserUnavailable:
|
||||||
|
# Login is not valid
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
class LoginResultPage(BasePage):
|
class LoginResultPage(BasePage):
|
||||||
def is_error(self):
|
def is_error(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue