Commit ff1f19ae authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon

[cragr] Added other wrongpass message

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
parent 82b7ad67
......@@ -142,7 +142,8 @@ class CragrAPI(LoginBrowser):
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)
......
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