Skip to content

Commit

Permalink
Fixed dangerous bug in connection handling
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Feb 12, 2016
1 parent 640fc5f commit b36314b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pretix/plugins/stripe/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def payment_perform(self, request, order) -> str:
'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.'))
Expand Down Expand Up @@ -166,7 +166,7 @@ def order_control_refund_perform(self, request, order) -> "bool|str":
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 '
Expand Down

0 comments on commit b36314b

Please sign in to comment.