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.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-04-30 17:08:43 +03:00
parent b924797869
commit b4ef65314d

View file

@ -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 (