From a598c3e7a816a2f158ea34db571027674dbccd9a Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 15 Aug 2018 11:25:47 +0200 Subject: [PATCH] Stripe: Catch exceptions when filling countries --- .../commands/stripe_connect_fill_countries.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pretix/plugins/stripe/management/commands/stripe_connect_fill_countries.py b/src/pretix/plugins/stripe/management/commands/stripe_connect_fill_countries.py index ed104a3721..295520479d 100644 --- a/src/pretix/plugins/stripe/management/commands/stripe_connect_fill_countries.py +++ b/src/pretix/plugins/stripe/management/commands/stripe_connect_fill_countries.py @@ -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')