From 02cf004500f5d5d3742d5c874df503646cd85eb6 Mon Sep 17 00:00:00 2001 From: Maxime Gasselin Date: Wed, 19 Aug 2020 19:01:07 +0200 Subject: [PATCH] [caissedepargne] Fix some true wrongpass for banquepopulaire We can have a failed_authentication here. To avoid to crash, a default value here allows to catch wrongpass further. Only seen for banquepopulaire module. An AssertionError has been added for caissedepargne in case of empty redirect_data. --- modules/caissedepargne/browser.py | 2 ++ modules/caissedepargne/pages.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/caissedepargne/browser.py b/modules/caissedepargne/browser.py index 0a041b8d15..07a0796bcf 100644 --- a/modules/caissedepargne/browser.py +++ b/modules/caissedepargne/browser.py @@ -684,6 +684,8 @@ def do_authentication_validation(self, authentication_method, feature, **params) self.page.check_errors(feature=feature) redirect_data = self.page.get_redirect_data() + assert redirect_data, 'redirect_data must not be empty' + self.location( redirect_data['action'], data={ diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index a861165f34..595734663a 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -226,7 +226,9 @@ def check_errors(self, feature): class AuthenticationStepPage(AuthenticationMethodPage): def get_redirect_data(self): - return Dict('response/saml2_post')(self.doc) + # In case of wrongpass the response key does not exist + # So it needs a default value + return Dict('response/saml2_post', default=NotAvailable)(self.doc) class VkImagePage(JsonPage): -- GitLab