bug fix
This commit is contained in:
@@ -337,9 +337,11 @@ def get_transactions(start_date,end_date):
|
||||
|
||||
for transaction in results:
|
||||
try:
|
||||
r = Rower.objects.filter(
|
||||
rs = Rower.objects.filter(
|
||||
customer_id=transaction.customer['id'],
|
||||
paymentprocessor='braintree')[0]
|
||||
paymentprocessor='braintree')
|
||||
if rs:
|
||||
r = rs[0]
|
||||
countries.append(r.country)
|
||||
names.append('{f} {l}'.format(
|
||||
f = r.user.first_name,
|
||||
@@ -350,7 +352,7 @@ def get_transactions(start_date,end_date):
|
||||
ids.append(r.id)
|
||||
usernames.append(r.user.username)
|
||||
|
||||
except KeyError:
|
||||
except (KeyError,IndexError):
|
||||
countries.append(
|
||||
transaction.credit_card_details.country_of_issuance)
|
||||
names.append('{f} {l}'.format(
|
||||
|
||||
Reference in New Issue
Block a user