diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-08 23:22:27 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-08 23:22:27 +0200 |
| commit | 180b672a652a8ea09484d9657957fa06dbcb83a8 (patch) | |
| tree | 3ff55f099c17305f4d4d8032e6f78306452a1eea | |
| parent | e0988ecd1ea90fc7c75ecd9f0959cef5fd9021ff (diff) | |
[py3] Fixed Python 3 compatibility in localflavor forms
| -rw-r--r-- | django/contrib/localflavor/br/forms.py | 4 | ||||
| -rw-r--r-- | django/contrib/localflavor/si/forms.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/localflavor/br/forms.py b/django/contrib/localflavor/br/forms.py index 4d0d6815ba..0f957be37f 100644 --- a/django/contrib/localflavor/br/forms.py +++ b/django/contrib/localflavor/br/forms.py @@ -154,10 +154,10 @@ class BRCNPJField(Field): raise ValidationError(self.error_messages['max_digits']) orig_dv = value[-2:] - new_1dv = sum([i * int(value[idx]) for idx, i in enumerate(range(5, 1, -1) + range(9, 1, -1))]) + new_1dv = sum([i * int(value[idx]) for idx, i in enumerate(list(range(5, 1, -1)) + list(range(9, 1, -1)))]) new_1dv = DV_maker(new_1dv % 11) value = value[:-2] + str(new_1dv) + value[-1] - new_2dv = sum([i * int(value[idx]) for idx, i in enumerate(range(6, 1, -1) + range(9, 1, -1))]) + new_2dv = sum([i * int(value[idx]) for idx, i in enumerate(list(range(6, 1, -1)) + list(range(9, 1, -1)))]) new_2dv = DV_maker(new_2dv % 11) value = value[:-1] + str(new_2dv) if value[-2:] != orig_dv: diff --git a/django/contrib/localflavor/si/forms.py b/django/contrib/localflavor/si/forms.py index aa4b9dac5a..bab35935fd 100644 --- a/django/contrib/localflavor/si/forms.py +++ b/django/contrib/localflavor/si/forms.py @@ -41,7 +41,7 @@ class SIEMSOField(CharField): # Validate EMSO s = 0 int_values = [int(i) for i in value] - for a, b in zip(int_values, range(7, 1, -1) * 2): + for a, b in zip(int_values, list(range(7, 1, -1)) * 2): s += a * b chk = s % 11 if chk == 0: |
