From c993de85bd6f14c535130a0c6cbe4edb78f24427 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Mon, 4 Jul 2016 19:05:52 -0600 Subject: [PATCH] Rename function. --- bikeshop_project/bikeshop/utils/member_import.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bikeshop_project/bikeshop/utils/member_import.py b/bikeshop_project/bikeshop/utils/member_import.py index 45a790c..33c6596 100644 --- a/bikeshop_project/bikeshop/utils/member_import.py +++ b/bikeshop_project/bikeshop/utils/member_import.py @@ -23,10 +23,10 @@ def email_generator(): return '{0}.{1}@example.com'.format(*local) -def payment_type(pt): - types = Payment.payment_choices +def get_payment_type(pt): + payment_types = Payment.payment_choices try: - return [type for type in types if type[1].lower() == pt.lower()][0] + return [payment_type for payment_type in payment_types if payment_type[1].lower() == pt.lower()][0] except IndexError: return 'UNKNOWN', 'Unknown' @@ -70,10 +70,10 @@ def member_import(): ) payment = Payment.objects.create( - type=payment_type(row.get('payment'))[0], + type=get_payment_type(row.get('payment'))[0], ) - membership = Membership.objects.create( + Membership.objects.create( renewed_at=renewed_at, self_identification=row.get('self_identification', None), gender=row.get('gender', None),