From 1151a000d98d3b2fa21dfbeee4c22f913e81b484 Mon Sep 17 00:00:00 2001 From: Maxime Pommier Date: Tue, 27 Nov 2018 16:01:24 +0100 Subject: [PATCH] [caissedepargne] Added ActionNeeded when user have to fill investment form --- modules/caissedepargne/pages.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index 1f44ec8b87..393b1b33c0 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -43,7 +43,7 @@ from weboob.tools.capabilities.bank.iban import is_rib_valid, rib2iban, is_iban_valid from weboob.tools.captcha.virtkeyboard import GridVirtKeyboard from weboob.tools.compat import unicode -from weboob.exceptions import NoAccountsException, BrowserUnavailable +from weboob.exceptions import NoAccountsException, BrowserUnavailable, ActionNeeded from weboob.browser.filters.json import Dict def MyDecimal(*args, **kwargs): @@ -207,6 +207,14 @@ def build_doc(self, content): return super(IndexPage, self).build_doc(content) def on_load(self): + + # For now, we have to handle this because after this warning message, + # the user is disconnected (even if all others account are reachable) + if 'NA_OIC_QCF' in self.browser.url: + message = CleanText(self.doc.xpath('//span[contains(@id, "MM_NA_OIC_QCF")]/p'))(self) + if message and "investissement financier (QCF) n’est plus valide à ce jour ou que vous avez refusé d’y répondre" in message: + raise ActionNeeded(message) + # This page is sometimes an useless step to the market website. bourse_link = Link(u'//div[@id="MM_COMPTE_TITRE_pnlbourseoic"]//a[contains(text(), "Accédez à la consultation")]', default=None)(self.doc) -- GitLab