Fix #275 -- Pass user executing a refund (for logging) (#287)

Except when triggered by a webhook.
This commit is contained in:
Tobias Kunze
2016-10-27 14:59:35 +02:00
committed by Raphael Michel
parent 2de328a33b
commit d13198167a
3 changed files with 5 additions and 5 deletions

View File

@@ -221,7 +221,7 @@ class Paypal(BasePaymentProvider):
payment_info = None
if not payment_info:
mark_order_refunded(order)
mark_order_refunded(order, user=request.user)
messages.warning(request, _('We were unable to transfer the money back automatically. '
'Please get in touch with the customer and transfer it back manually.'))
return
@@ -239,7 +239,7 @@ class Paypal(BasePaymentProvider):
'Please get in touch with the customer and transfer it back manually.'))
else:
sale = paypalrestsdk.Payment.find(payment_info['id'])
order = mark_order_refunded(order)
order = mark_order_refunded(order, user=request.user)
order.payment_info = json.dumps(sale.to_dict())
order.save()