Skip to content

Commit

Permalink
Merge pull request #1 from awesto/fix-warnings
Browse files Browse the repository at this point in the history
Fix ``warnings.warn`` calls
  • Loading branch information
rfleschenberg authored Nov 7, 2016
2 parents 03f7de8 + d8b8067 commit a0bf5c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shop_paypal/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ def return_view(cls, request):
payment_id = request.GET['paymentId']
params = {'payer_id': request.GET['PayerID']}
except KeyError as err:
warnings.warn("Request for PayPal return_url is invalid: ", err.message)
warnings.warn("Request for PayPal return_url is invalid: {}".format(err.message))
return HttpResponseBadRequest("Invalid Payment Request")
try:
cls.get_auth_token()
payment = paypalrestsdk.Payment.find(payment_id)
approved = payment.execute(params)
except Exception as err:
warnings.warn("An internal error occurred on the upstream server: ", err.message)
warnings.warn("An internal error occurred on the upstream server: {}".format(err.message))
return cls.cancel_view(request)
if approved:
cart = CartModel.objects.get_from_request(request)
Expand Down

0 comments on commit a0bf5c4

Please sign in to comment.