From c78d861c244c953023ad8a128a0749d077b4e356 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sat, 30 Apr 2011 13:40:05 +0000 Subject: [PATCH] Fixed #15640 -- Added new initial digit in Spain phone numbers to localflavor's ESPhoneNumberField form field. Thanks, Claude Paroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16132 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/localflavor/es/forms.py | 2 +- tests/regressiontests/forms/localflavor/es.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/django/contrib/localflavor/es/forms.py b/django/contrib/localflavor/es/forms.py index b61860d500..000f695630 100644 --- a/django/contrib/localflavor/es/forms.py +++ b/django/contrib/localflavor/es/forms.py @@ -41,7 +41,7 @@ class ESPhoneNumberField(RegexField): } def __init__(self, *args, **kwargs): - super(ESPhoneNumberField, self).__init__(r'^(6|8|9)\d{8}$', + super(ESPhoneNumberField, self).__init__(r'^(6|7|8|9)\d{8}$', max_length=None, min_length=None, *args, **kwargs) class ESIdentityCardNumberField(RegexField): diff --git a/tests/regressiontests/forms/localflavor/es.py b/tests/regressiontests/forms/localflavor/es.py index b584075513..95a94c4fa8 100644 --- a/tests/regressiontests/forms/localflavor/es.py +++ b/tests/regressiontests/forms/localflavor/es.py @@ -108,10 +108,11 @@ class ESLocalFlavorTests(LocalFlavorTestCase): '650010101': '650010101', '931234567': '931234567', '800123123': '800123123', + '789789789': '789789789', } invalid = { '555555555': error_invalid, - '789789789': error_invalid, + '489489489': error_invalid, '99123123': error_invalid, '9999123123': error_invalid, }