Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed a stray tab in django.contrib.localflavor.fi.forms

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit bebf06611f57dcdaf4128247ba51e6ca87065656 1 parent 03d3d9f
@adrianholovaty adrianholovaty authored
Showing with 6 additions and 8 deletions.
  1. +6 −8 django/contrib/localflavor/fi/forms.py
View
14 django/contrib/localflavor/fi/forms.py
@@ -26,8 +26,8 @@ class FISocialSecurityNumber(Field):
def clean(self, value):
super(FISocialSecurityNumber, self).clean(value)
if value in EMPTY_VALUES:
- return u''
-
+ return u''
+
checkmarks = "0123456789ABCDEFHJKLMNPRSTUVWXY"
result = re.match(r"""^
(?P<date>([0-2]\d|3[01])
@@ -35,13 +35,11 @@ def clean(self, value):
(\d{2}))
[A+-]
(?P<serial>(\d{3}))
- (?P<chechsum>[%s])$""" % checkmarks, value, re.VERBOSE | re.IGNORECASE)
+ (?P<checksum>[%s])$""" % checkmarks, value, re.VERBOSE | re.IGNORECASE)
if not result:
raise ValidationError(gettext(u'Enter a valid Finnish social security number.'))
- checksum = int(result.groupdict()['date'] + result.groupdict()['serial'])
-
- if checkmarks[checksum % len(checkmarks)] == result.groupdict()['chechsum'].upper():
+ gd = match.groupdict()
+ checksum = int(gd['date'] + gd['serial'])
+ if checkmarks[checksum % len(checkmarks)] == gd['checksum'].upper():
return u'%s' % value.upper()
-
raise ValidationError(gettext(u'Enter a valid Finnish social security number.'))
-

0 comments on commit bebf066

Please sign in to comment.
Something went wrong with that request. Please try again.