diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-04-03 22:33:28 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-04-03 22:33:28 +0000 |
| commit | f791a598a8e207a6f362ea75b9474f7739b518c7 (patch) | |
| tree | 99e9546aa43a18980e878861e0d788bbc144f3c8 | |
| parent | 87471549b3f13ce44968655fba4e19cdbc235c77 (diff) | |
Negligible formatting changes to some recent commits
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/localflavor/usa/forms.py | 10 | ||||
| -rw-r--r-- | setup.py | 2 | ||||
| -rw-r--r-- | tests/regressiontests/forms/localflavor.py | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/django/contrib/localflavor/usa/forms.py b/django/contrib/localflavor/usa/forms.py index e61c03b702..8d76a9269e 100644 --- a/django/contrib/localflavor/usa/forms.py +++ b/django/contrib/localflavor/usa/forms.py @@ -43,28 +43,26 @@ class USSocialSecurityNumberField(Field): * The number is not one known to be invalid due to otherwise widespread promotional use or distribution (e.g., the Woolworth's number or the 1962 promotional number). - """ def clean(self, value): super(USSocialSecurityNumberField, self).clean(value) if value in EMPTY_VALUES: return u'' - msg = gettext(u'Enter a valid US Social Security number in XXX-XX-XXXX format') + msg = gettext(u'Enter a valid U.S. Social Security number in XXX-XX-XXXX format.') match = re.match(ssn_re, value) if not match: raise ValidationError(msg) area, group, serial = match.groupdict()['area'], match.groupdict()['group'], match.groupdict()['serial'] - + # First pass: no blocks of all zeroes. if area == '000' or \ group == '00' or \ serial == '0000': raise ValidationError(msg) - + # Second pass: promotional and otherwise permanently invalid numbers. if area == '666' or \ - (area == '987' and group == '65' and \ - 4320 <= int(serial) <= 4329) or \ + (area == '987' and group == '65' and 4320 <= int(serial) <= 4329) or \ value == '078-05-1120' or \ value == '219-09-9999': raise ValidationError(msg) @@ -30,7 +30,7 @@ root_dir = os.path.dirname(__file__) django_dir = os.path.join(root_dir, 'django') pieces = fullsplit(root_dir) if pieces[-1] == '': - len_root_dir = len(pieces)- 1 + len_root_dir = len(pieces) - 1 else: len_root_dir = len(pieces) diff --git a/tests/regressiontests/forms/localflavor.py b/tests/regressiontests/forms/localflavor.py index e05078ea46..a9d2126e38 100644 --- a/tests/regressiontests/forms/localflavor.py +++ b/tests/regressiontests/forms/localflavor.py @@ -256,7 +256,7 @@ u'987-65-4330' >>> f.clean('078-05-1120') Traceback (most recent call last): ... -ValidationError: [u'Enter a valid US Social Security number in XXX-XX-XXXX format'] +ValidationError: [u'Enter a valid U.S. Social Security number in XXX-XX-XXXX format.'] # UKPostcodeField ############################################################# |
