Stripe: Catch exceptions when filling countries

This commit is contained in:
Raphael Michel
2018-08-15 11:25:47 +02:00
parent d9f5ee9d76
commit a598c3e7a8

View File

@@ -22,8 +22,12 @@ class Command(BaseCommand):
if uid in cache:
e.settings.payment_stripe_merchant_country = cache[uid]
else:
account = stripe.Account.retrieve(
uid,
api_key=api_key
)
e.settings.payment_stripe_merchant_country = cache[uid] = account.get('country')
try:
account = stripe.Account.retrieve(
uid,
api_key=api_key
)
except Exception as e:
print(e)
else:
e.settings.payment_stripe_merchant_country = cache[uid] = account.get('country')