Commit de85343f authored by Baptiste Delpey's avatar Baptiste Delpey Committed by Romain Bignon

handle new pass required

parent fa6dd434
......@@ -20,13 +20,14 @@
from weboob.browser import LoginBrowser, URL, need_login
from .pages import LoginPage, AccountsPage, TransactionsPage
from .pages import LoginPage, AccountsPage, TransactionsPage, PassModificationPage
class SogecartesBrowser(LoginBrowser):
BASEURL = 'https://www.sogecartenet.fr/'
login = URL('/internationalisation/identification', LoginPage)
pass_modification = URL('/internationalisation/./modificationMotPasse.*', PassModificationPage)
accounts = URL('/internationalisation/gestionParcCartes', AccountsPage)
transactions = URL('/internationalisation/csv/operationsParCarte.*', TransactionsPage)
......@@ -42,7 +43,7 @@ class SogecartesBrowser(LoginBrowser):
"LANGUE": "en",
"QUEFAIRE": "LOGIN",
}
self.login.open(data=data)
self.login.go(data=data)
@need_login
def iter_accounts(self):
......
......@@ -20,7 +20,7 @@
import requests
from weboob.browser.pages import HTMLPage, CsvPage, pagination
from weboob.exceptions import BrowserIncorrectPassword
from weboob.exceptions import BrowserIncorrectPassword, BrowserPasswordExpired
from weboob.browser.elements import DictElement, ItemElement, method, TableElement
from weboob.browser.filters.standard import CleanText, CleanDecimal, Date, Env, TableCell
from weboob.browser.filters.json import Dict
......@@ -30,6 +30,10 @@ from weboob.tools.capabilities.bank.transactions import FrenchTransaction
__all__ = ['LoginPage', 'AccountsPage', 'TransactionsPage']
class PassModificationPage(HTMLPage):
def on_load(self):
raise BrowserPasswordExpired('New pass needed')
class LoginPage(HTMLPage):
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment