From b699ddc3f904f5dd207df7ded9d5bfc7510556bc Mon Sep 17 00:00:00 2001 From: Vincent Paredes Date: Wed, 8 Oct 2014 17:40:04 +0200 Subject: [PATCH] Regexp for checking password --- modules/cragr/module.py | 2 +- modules/cragr/web/pages.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/cragr/module.py b/modules/cragr/module.py index 7c49fa13..bf41ad40 100644 --- a/modules/cragr/module.py +++ b/modules/cragr/module.py @@ -80,7 +80,7 @@ class CragrModule(Module, CapBank): }.iteritems())]) CONFIG = BackendConfig(Value('website', label=u'Région', choices=website_choices), ValueBackendPassword('login', label=u'N° de compte', masked=False), - ValueBackendPassword('password', label=u'Code personnel')) + ValueBackendPassword('password', label=u'Code personnel', regexp=r'\d{6}')) BROWSER = Cragr def create_default_browser(self): diff --git a/modules/cragr/web/pages.py b/modules/cragr/web/pages.py index 9ba99ad8..ad944f54 100644 --- a/modules/cragr/web/pages.py +++ b/modules/cragr/web/pages.py @@ -42,9 +42,6 @@ class HomePage(Page): class LoginPage(Page): def login(self, password): - assert password.isdigit() - assert len(password) == 6 - imgmap = {} for td in self.document.xpath('//table[@id="pave-saisie-code"]/tr/td'): a = td.find('a')