From ff1f19aee3c0d35b42dfbed8d46218bcf16ef50b Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Thu, 31 Jan 2019 15:50:44 +0100 Subject: [PATCH] [cragr] Added other wrongpass message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some connections raise another error at Login: "Vous n'avez plus droit qu'à une seule tentative; à la prochaine saisie erronée, votre accès sera bloqué" that has to be handled as a wrongpass. Closes: 35415@Sibi --- modules/cragr/api/browser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/cragr/api/browser.py b/modules/cragr/api/browser.py index 0e0d44a7be..9039ccf666 100644 --- a/modules/cragr/api/browser.py +++ b/modules/cragr/api/browser.py @@ -142,7 +142,8 @@ def do_login(self): error = exc.response.json().get('error') if error: message = error.get('message', '') - if 'Votre identification est incorrecte' in message: + wrongpass_messages = ("Votre identification est incorrecte", "Vous n'avez plus droit") + if any(value in message for value in wrongpass_messages): raise BrowserIncorrectPassword() if 'obtenir un nouveau code' in message: raise ActionNeeded(message) -- GitLab