From 843fadd8c1c704bdb750213d1f90ece6a5459ba2 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Wed, 30 Jan 2019 18:22:36 +0100 Subject: [PATCH] [cragr] Add regexp to login to prevent server errors On the new cragr website, you cannot POST the login+password with a space at the end of the password, otherwise the website returns a 500 error. This commit adds a regexp in module.py to raise an error instead of a browser unavailable when credentials contain something else than digits. Closes: 9356@zendesk, 35699@sibi --- modules/cragr/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cragr/module.py b/modules/cragr/module.py index dca84fbefd..b47507a89b 100644 --- a/modules/cragr/module.py +++ b/modules/cragr/module.py @@ -84,7 +84,7 @@ class CragrModule(Module, CapBankWealth, CapBankTransferAddRecipient, CapContact }.items())]) CONFIG = BackendConfig(Value('website', label=u'Région', choices=website_choices), - ValueBackendPassword('login', label=u'N° de compte', masked=False), + ValueBackendPassword('login', label=u'N° de compte', masked=False, regexp=r'\d+'), ValueBackendPassword('password', label=u'Code personnel', regexp=r'\d{6}')) BROWSER = ProxyBrowser -- GitLab