Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Don't include products from descendants of given category

Marcin Gębala5dfe13f02217
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py
index fb8892940c..9d5472c0a1 100644
--- a/saleor/graphql/api.py
+++ b/saleor/graphql/api.py
@@ -119,8 +119,7 @@ class CategoryType(DjangoObjectType):
def resolve_products(self, info, **args):
context = info.context
qs = products_for_api(context.user)
- tree = self.get_descendants(include_self=True)
- qs = qs.filter(categories__in=tree)
+ qs = qs.filter(categories=self)
attributes_filter, order_by, price_lte, price_gte = map(
args.get, ['attributes', 'order_by', 'price_lte', 'price_gte'])