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