From 12c21181d9bee8c402619ba399e91cd2bf9fd0ff Mon Sep 17 00:00:00 2001 From: Jawad Khan Date: Fri, 27 Sep 2024 17:15:24 +0500 Subject: [PATCH] fix: refectored code --- ecommerce/extensions/dashboard/orders/views.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ecommerce/extensions/dashboard/orders/views.py b/ecommerce/extensions/dashboard/orders/views.py index 2b4e00323a8..16d786d3ffd 100644 --- a/ecommerce/extensions/dashboard/orders/views.py +++ b/ecommerce/extensions/dashboard/orders/views.py @@ -87,6 +87,4 @@ def create_refund(self, request, order, lines, _quantities): # pylint: disable= return self.reload_page() def _is_order_from_mobile(self, order): - processor_responses = order.basket.paymentprocessorresponse_set.all() - return any(response.processor_name in MOBILE_PAYMENT_PROCESSORS - for response in processor_responses) + return order.basket.paymentprocessorresponse_set.filter(processor_name__in=MOBILE_PAYMENT_PROCESSORS).exists()