diff --git a/registration/admin.py b/registration/admin.py index 935b6fbd..e70635aa 100644 --- a/registration/admin.py +++ b/registration/admin.py @@ -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 diff --git a/registration/payments.py b/registration/payments.py index 2001efd6..d2911653 100644 --- a/registration/payments.py +++ b/registration/payments.py @@ -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 @@ -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}"