Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored

Showing 1 changed file with 6 additions and 8 deletions. Show diff stats Hide diff stats

  1. 14  django/contrib/localflavor/fi/forms.py
14  django/contrib/localflavor/fi/forms.py
@@ -26,8 +26,8 @@ class FISocialSecurityNumber(Field):
26 26
     def clean(self, value):
27 27
         super(FISocialSecurityNumber, self).clean(value)
28 28
         if value in EMPTY_VALUES:
29  
- 	        return u''
30  
-        
  29
+            return u''
  30
+
31 31
         checkmarks = "0123456789ABCDEFHJKLMNPRSTUVWXY"
32 32
         result = re.match(r"""^
33 33
             (?P<date>([0-2]\d|3[01])
@@ -35,13 +35,11 @@ def clean(self, value):
35 35
             (\d{2}))
36 36
             [A+-]
37 37
             (?P<serial>(\d{3}))
38  
-            (?P<chechsum>[%s])$""" % checkmarks, value, re.VERBOSE | re.IGNORECASE)
  38
+            (?P<checksum>[%s])$""" % checkmarks, value, re.VERBOSE | re.IGNORECASE)
39 39
         if not result:
40 40
             raise ValidationError(gettext(u'Enter a valid Finnish social security number.'))
41  
-        checksum = int(result.groupdict()['date'] + result.groupdict()['serial'])
42  
-
43  
-        if checkmarks[checksum % len(checkmarks)] == result.groupdict()['chechsum'].upper():
  41
+        gd = match.groupdict()
  42
+        checksum = int(gd['date'] + gd['serial'])
  43
+        if checkmarks[checksum % len(checkmarks)] == gd['checksum'].upper():
44 44
             return u'%s' % value.upper()
45  
-        
46 45
         raise ValidationError(gettext(u'Enter a valid Finnish social security number.'))
47  
-

0 notes on commit bebf066

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