From 69c567e6fd456eb04344569f94f12d66dd097cb8 Mon Sep 17 00:00:00 2001 From: Vincent Ardisson Date: Thu, 11 Jun 2020 10:51:12 +0200 Subject: [PATCH] [caissedepargne] don't logout during transfers, it breaks 'em AuthenticationMethodPage was missing "logged". Since the page is also used at login, try to distinguish cases. --- modules/caissedepargne/pages.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index 824d04e992..18622a7086 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -119,6 +119,21 @@ def send_form(self): class AuthenticationMethodPage(JsonPage): + @property + def logged(self): + try: + context, = list(self.doc.get('context', {})) + except ValueError: + self.logger.warning("oops, we don't know if we're at login or during other authentication") + return False + + return ( + # can be VIR_SEPA_FR or VIR_SEPA + context.startswith('VIR_') + # adding a recipient + or context == 'AJOUT_CPT' + ) + def get_validation_id(self): return Dict('id')(self.doc) -- GitLab