From b36314b9090b3459a50e5f88ece6a08690b50053 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 12 Feb 2016 09:33:48 +0100 Subject: [PATCH] Fixed dangerous bug in connection handling --- src/pretix/plugins/stripe/payment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pretix/plugins/stripe/payment.py b/src/pretix/plugins/stripe/payment.py index e16869f0d8..56876c6ade 100644 --- a/src/pretix/plugins/stripe/payment.py +++ b/src/pretix/plugins/stripe/payment.py @@ -99,8 +99,8 @@ class Stripe(BasePaymentProvider): 'message': err['message'], }) order.save() - except stripe.error.InvalidRequestError or stripe.error.AuthenticationError or stripe.error.APIConnectionError \ - or stripe.error.StripeError as e: + except (stripe.error.InvalidRequestError, stripe.error.AuthenticationError, stripe.error.APIConnectionError, + stripe.error.StripeError) as e: err = e.json_body['error'] messages.error(request, _('We had trouble communicating with Stripe. Please try again and get in touch ' 'with us if this problem persists.')) @@ -166,7 +166,7 @@ class Stripe(BasePaymentProvider): ch = stripe.Charge.retrieve(payment_info['id']) ch.refunds.create() ch.refresh() - except stripe.error.InvalidRequestError or stripe.error.AuthenticationError or stripe.error.APIConnectionError \ + except (stripe.error.InvalidRequestError, stripe.error.AuthenticationError, stripe.error.APIConnectionError) \ as e: err = e.json_body['error'] messages.error(request, _('We had trouble communicating with Stripe. Please try again and contact '