From b4ef65314d12db4cc41cef852e7ce50c8744827e Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Wed, 30 Apr 2025 17:08:43 +0300 Subject: [PATCH] Update query logic to fix invalid method chaining Removed invalid `select_related` and `prefetch_related` chaining on the product query. This resolves potential errors in fetching related data and ensures proper functionality. --- core/graphene/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/graphene/schema.py b/core/graphene/schema.py index 40ffe63c..39db3442 100644 --- a/core/graphene/schema.py +++ b/core/graphene/schema.py @@ -129,7 +129,7 @@ class Query(ObjectType): if info.context.user.is_authenticated and kwargs.get("uuid"): product = Product.objects.get( uuid=kwargs["uuid"] - ).select_related("brand", "category").prefetch_related("images", "stocks") + ) if product.is_active and product.brand.is_active and product.category.is_active: info.context.user.add_to_recently_viewed(product.uuid) return (