Skip to content

Commit 0ca17e2

Browse files
committed
Merge pull request #167 from yakky/feature/it_ssn_number_message
Fix Italian Tax code error message
2 parents 17596f4 + f920656 commit 0ca17e2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

localflavor/it/forms.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ def __init__(self, attrs=None):
6060

6161
class ITSocialSecurityNumberField(RegexField):
6262
"""
63-
A form field that validates Italian Social Security numbers (codice fiscale) for
64-
both persons and entities.
63+
A form field that validates Italian Tax code (codice fiscale) for both persons and entities.
6564
6665
For reference see http://www.agenziaentrate.it/ and search for:
6766
@@ -74,7 +73,7 @@ class ITSocialSecurityNumberField(RegexField):
7473
entities (numeric-only form).
7574
"""
7675
default_error_messages = {
77-
'invalid': _('Enter a valid Social Security number.'),
76+
'invalid': _('Enter a valid Tax code.'),
7877
}
7978

8079
def __init__(self, max_length=None, min_length=None, *args, **kwargs):

localflavor/locale/en/LC_MESSAGES/django.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5779,7 +5779,7 @@ msgid "Enter a valid zip code."
57795779
msgstr ""
57805780

57815781
#: it/forms.py:77
5782-
msgid "Enter a valid Social Security number."
5782+
msgid "Enter a valid Tax code."
57835783
msgstr ""
57845784

57855785
#: it/forms.py:109

tests/test_it.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def test_ITZipCodeField(self):
207207
self.assertFieldOutput(ITZipCodeField, valid, invalid)
208208

209209
def test_ITSocialSecurityNumberField(self):
210-
error_invalid = ['Enter a valid Social Security number.']
210+
error_invalid = ['Enter a valid Tax code.']
211211
valid = {
212212
'LVSGDU99T71H501L': 'LVSGDU99T71H501L',
213213
'LBRRME11A01L736W': 'LBRRME11A01L736W',
@@ -221,7 +221,7 @@ def test_ITSocialSecurityNumberField(self):
221221
self.assertFieldOutput(ITSocialSecurityNumberField, valid, invalid)
222222

223223
def test_ITSocialSecurityNumberField_for_entities(self):
224-
error_invalid = ['Enter a valid Social Security number.']
224+
error_invalid = ['Enter a valid Tax code.']
225225
valid = {
226226
'07973780013': '07973780013',
227227
'7973780013': '07973780013',

0 commit comments

Comments
 (0)