From a43068648bb880d6fa8222add53722b2c2af0feb Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Wed, 21 Jan 2015 10:40:03 +0100 Subject: [PATCH] allow birthday to be entered with separators --- modules/ing/browser.py | 3 ++- modules/ing/module.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ing/browser.py b/modules/ing/browser.py index 239b89a4..68b7f47f 100644 --- a/modules/ing/browser.py +++ b/modules/ing/browser.py @@ -16,6 +16,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +import re import hashlib from weboob.browser import LoginBrowser, URL, need_login @@ -60,7 +61,7 @@ class IngBrowser(LoginBrowser): billpage = URL('/protected/pages/common/estatement/eStatement.jsf', BillsPage) def __init__(self, *args, **kwargs): - self.birthday = kwargs.pop('birthday', None) + self.birthday = re.sub(r'[^\d]', '', kwargs.pop('birthday')) self.where = None LoginBrowser.__init__(self, *args, **kwargs) diff --git a/modules/ing/module.py b/modules/ing/module.py index dbb4fecf..4d30efb3 100644 --- a/modules/ing/module.py +++ b/modules/ing/module.py @@ -46,7 +46,7 @@ class INGModule(Module, CapBank, CapBill): regexp='^(\d{6}|)$'), ValueBackendPassword('birthday', label='Date de naissance', - regexp='^(\d{8}|)$', + regexp='^(\d{2}[/-]?\d{2}[/-]?\d{4}|)$', masked=False) ) BROWSER = IngBrowser