From cf3907cca7dd138acb03a9caf37e582aace0c091 Mon Sep 17 00:00:00 2001 From: albertoconnor Date: Wed, 20 Jul 2016 22:44:18 -0400 Subject: [PATCH] Update forms.py --- zebra/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zebra/forms.py b/zebra/forms.py index 0041320..ff3057a 100644 --- a/zebra/forms.py +++ b/zebra/forms.py @@ -2,6 +2,8 @@ from django.core.exceptions import NON_FIELD_ERRORS from django.utils.dates import MONTHS +from six import iteritems + from zebra.conf import options from zebra.widgets import NoNameSelect, NoNameTextInput @@ -23,7 +25,7 @@ def __init__(self, *args, **kwargs): self.fields['card_cvv'].label = "Card CVC" self.fields['card_cvv'].help_text = "Card Verification Code; see rear of card." months = [ (m[0], u'%02d - %s' % (m[0], unicode(m[1]))) - for m in sorted(MONTHS.iteritems()) ] + for m in sorted(iteritems(MONTHS)) ] self.fields['card_expiry_month'].choices = months card_number = forms.CharField(required=False, max_length=20, @@ -31,6 +33,6 @@ def __init__(self, *args, **kwargs): card_cvv = forms.CharField(required=False, max_length=4, widget=NoNameTextInput()) card_expiry_month = forms.ChoiceField(required=False, widget=NoNameSelect(), - choices=MONTHS.iteritems()) + choices=iteritems(MONTHS)) card_expiry_year = forms.ChoiceField(required=False, widget=NoNameSelect(), choices=options.ZEBRA_CARD_YEARS_CHOICES)