Skip to content

Commit

Permalink
Woops
Browse files Browse the repository at this point in the history
  • Loading branch information
rechner committed Feb 2, 2024
1 parent 5f28d41 commit 61f433e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions registration/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,12 +1330,11 @@ def render_change_form(self, request, context, *args, **kwargs):
f"Error while loading JSON from apiData field for this order: {obj}",
)
logger.warning(
request,
f"Error while loading JSON from api_data for order {obj}",
)
else:
if "dispute" in obj.apiData:
messages.warning("This transaction has been disputed")
messages.warning(request, "This transaction has been disputed")

return super(OrderAdmin, self).render_change_form(
request, context, *args, **kwargs
Expand Down
6 changes: 3 additions & 3 deletions registration/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ def process_webhook_refund_update(notification) -> bool:
def process_webhook_payment_updated(notification: PaymentWebhookNotification) -> bool:
payment_id = notification.body["data"]["id"]
try:
order = Order.objects.get(apiData__payment={"id": payment_id})
order = Order.objects.get(apiData__payment__id=payment_id)
except Order.DoesNotExist:
logger.warning(
f"Got refund.updated webhook update for a payment id not found: {payment_id}"
f"Got payment.updated webhook update for a payment id not found: {payment_id}"
)
return False

Expand All @@ -413,7 +413,7 @@ def process_webhook_refund_created(notification: PaymentWebhookNotification) ->
webhook_refund = notification.body["data"]["object"]["refund"]
payment_id = webhook_refund["payment_id"]
try:
order = Order.objects.get(apiData__payment={"id": payment_id})
order = Order.objects.get(apiData__payment__id=payment_id)
except Order.DoesNotExist:
logger.warning(
f"Got refund.created webhook update for a payment id not found: {payment_id}"
Expand Down

0 comments on commit 61f433e

Please sign in to comment.