From ae7d78f4b1516fe9f9afed6943d12f52e64a51f4 Mon Sep 17 00:00:00 2001 From: Florian Duguet Date: Mon, 26 Nov 2018 15:13:07 +0100 Subject: [PATCH] [ameli] add regex to login field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit login is 'Numéro de sécurité social' and it has always 13 digits but some users write 15 digits because of the key at the end, which is present on 'Vitale' card, but not here --- modules/ameli/module.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/ameli/module.py b/modules/ameli/module.py index 5f6789a6a7..48bb8a71dd 100644 --- a/modules/ameli/module.py +++ b/modules/ameli/module.py @@ -35,13 +35,8 @@ class AmeliModule(Module, CapDocument): VERSION = '1.4' LICENSE = 'AGPLv3+' BROWSER = AmeliBrowser - CONFIG = BackendConfig(ValueBackendPassword('login', - label='Numero de SS', - masked=False), - ValueBackendPassword('password', - label='Password', - masked=True) - ) + CONFIG = BackendConfig(ValueBackendPassword('login', label='Numero de SS', regexp=r'^\d{13}$', masked=False), + ValueBackendPassword('password', label='Password', masked=True)) def create_default_browser(self): return self.create_browser(self.config['login'].get(), -- GitLab