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:
parent
b924797869
commit
b4ef65314d
1 changed files with 1 additions and 1 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Reference in a new issue