Changeset 4917
- Timestamp:
- 04/03/07 17:33:28 (2 years ago)
- Files:
-
- django/trunk/django/contrib/localflavor/usa/forms.py (modified) (3 diffs)
- django/trunk/setup.py (modified) (1 diff)
- django/trunk/tests/regressiontests/forms/localflavor.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/localflavor/usa/forms.py
r4910 r4917 44 44 promotional use or distribution (e.g., the Woolworth's number or the 1962 45 45 promotional number). 46 47 46 """ 48 47 def clean(self, value): … … 50 49 if value in EMPTY_VALUES: 51 50 return u'' 52 msg = gettext(u'Enter a valid U S Social Security number in XXX-XX-XXXX format')51 msg = gettext(u'Enter a valid U.S. Social Security number in XXX-XX-XXXX format.') 53 52 match = re.match(ssn_re, value) 54 53 if not match: 55 54 raise ValidationError(msg) 56 55 area, group, serial = match.groupdict()['area'], match.groupdict()['group'], match.groupdict()['serial'] 57 56 58 57 # First pass: no blocks of all zeroes. 59 58 if area == '000' or \ … … 61 60 serial == '0000': 62 61 raise ValidationError(msg) 63 62 64 63 # Second pass: promotional and otherwise permanently invalid numbers. 65 64 if area == '666' or \ 66 (area == '987' and group == '65' and \ 67 4320 <= int(serial) <= 4329) or \ 65 (area == '987' and group == '65' and 4320 <= int(serial) <= 4329) or \ 68 66 value == '078-05-1120' or \ 69 67 value == '219-09-9999': django/trunk/setup.py
r4912 r4917 31 31 pieces = fullsplit(root_dir) 32 32 if pieces[-1] == '': 33 len_root_dir = len(pieces) - 133 len_root_dir = len(pieces) - 1 34 34 else: 35 35 len_root_dir = len(pieces) django/trunk/tests/regressiontests/forms/localflavor.py
r4910 r4917 257 257 Traceback (most recent call last): 258 258 ... 259 ValidationError: [u'Enter a valid U S Social Security number in XXX-XX-XXXX format']259 ValidationError: [u'Enter a valid U.S. Social Security number in XXX-XX-XXXX format.'] 260 260 261 261 # UKPostcodeField #############################################################
