The new woob repository is here: This gitlab will be removed soon.

Commit def92556 authored by Martin Sicot's avatar Martin Sicot Committed by Romain Bignon

[banquetarneaud] Fix login when rgpd pops

Sometimes, an rgpd pages pop when trying to logging, causing an
ActionNeeded. This page (that the user don't see) can be by-passed
by going on the bypass_rgpd url. This is what we do every time now when
we try to logging if we retrieve this page.
closes: 9023@zendesk
closes: 9529@zendesk
parent 27e44cf0
......@@ -20,14 +20,14 @@
from __future__ import unicode_literals
from weboob.browser import LoginBrowser, URL, need_login
from weboob.exceptions import BrowserIncorrectPassword, BrowserPasswordExpired
from weboob.exceptions import BrowserIncorrectPassword, BrowserPasswordExpired, ActionNeeded
from import Account
from weboob.capabilities.base import find_object
from import create_french_liquidity
from .pages import (
LoginPage, ProfilePage, AccountTypePage, AccountsPage, ProAccountsPage,
TransactionsPage, IbanPage, RedirectPage, EntryPage, AVPage, ProIbanPage,
ProTransactionsPage, LabelsPage,
ProTransactionsPage, LabelsPage, RgpdPage,
class CreditDuNordBrowser(LoginBrowser):
......@@ -50,6 +50,7 @@ class CreditDuNordBrowser(LoginBrowser):
account_type_page = URL("/icd/zco/public-data/public-ws-menuespaceperso.json", AccountTypePage)
labels_page = URL("/icd/zco/public-data/ws-menu.json", LabelsPage)
profile_page = URL("/icd/zco/data/user.json", ProfilePage)
bypass_rgpd = URL('/icd/zcd/data/gdpr-get-out-zs-client.json', RgpdPage)
def __init__(self, website, *args, **kwargs):
self.weboob = kwargs['weboob']
......@@ -104,7 +105,14 @@ def _iter_accounts(self):
def get_pages_labels(self):
# When retrieving labels_page,
# If GDPR was accepted partially the website throws a page that we treat
# as an ActionNeeded. Sometime we can by-pass it. Hence this fix
except ActionNeeded:
......@@ -169,7 +169,7 @@ def on_load(self):
if Dict('commun/statut', default='')(self.doc) == 'nok':
reason = Dict('commun/raison')(self.doc)
assert reason == 'GDPR', 'Labels page is not available with message %s' % reason
raise ActionNeeded()
raise ActionNeeded(reason)
def get_labels(self):
synthesis_labels = ["synthèse"]
......@@ -794,3 +794,7 @@ def get_history(self, account):
yield t
class RgpdPage(LoggedPage, CDNBasePage):
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