Commit 8a1b9c94 authored by Baptiste Delpey's avatar Baptiste Delpey Committed by Romain Bignon

sogecartenet better handling of wrongpass

parent ad15d7fa
......@@ -18,7 +18,6 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.exceptions import BrowserIncorrectPassword
from weboob.browser import LoginBrowser, URL, need_login
from .pages import LoginPage, AccountsPage, TransactionsPage
......@@ -44,8 +43,6 @@ class SogecartesBrowser(LoginBrowser):
"QUEFAIRE": "LOGIN",
}
self.login.open(data=data)
if self.login.is_here():
raise BrowserIncorrectPassword()
@need_login
def iter_accounts(self):
......
......@@ -20,6 +20,7 @@
import requests
from weboob.browser.pages import HTMLPage, CsvPage, pagination
from weboob.exceptions import BrowserIncorrectPassword
from weboob.browser.elements import ListElement, DictElement, ItemElement, method
from weboob.browser.filters.standard import CleanText, CleanDecimal, Date, Env
from weboob.browser.filters.json import Dict
......@@ -39,6 +40,10 @@ class SogeLoggedPage(object):
return not self.doc.xpath('//input[@value="LOGIN"][@name="QUEFAIRE"]')
return True
def on_load(self):
if hasattr(self.doc, 'xpath') and self.doc.xpath('//input[@value="LOGIN"][@name="QUEFAIRE"]'):
raise BrowserIncorrectPassword()
class AccountsPage(SogeLoggedPage, HTMLPage):
@pagination
@method
......
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