Kaydet (Commit) 3eb1071b authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Fixed #4865 -- Replaced a stray generator comprehension with a list

comprehension so that we don't break Python 2.3.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5685 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst e4bcfc27
# -*- coding: iso-8859-1 -*-
"""
Norwegian-specific Form helpers
"""
......@@ -66,7 +65,7 @@ class NOSocialSecurityNumber(Field):
weight_2 = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]
def multiply_reduce(aval, bval):
return sum((a * b) for (a, b) in zip(aval, bval))
return sum([(a * b) for (a, b) in zip(aval, bval)])
if multiply_reduce(digits, weight_1) % 11 != 0:
raise ValidationError(msg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment