Skip to content

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

Ignore filters with bad values instead of raising an error

Marcin Gębala06867d14706c
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py
index 626cbee8ab..b5d2e3cfd6 100644
--- a/saleor/graphql/api.py
+++ b/saleor/graphql/api.py
@@ -118,15 +118,14 @@ class CategoryType(DjangoObjectType):
try:
attr_pk = attributes_map[attr_name]
except KeyError:
- raise ValueError("Invalid attribute name: %s" % attr_name)
+ attr_pk = None
else:
try:
attr_val_pk = values_map[attr_name][val_slug]
except KeyError:
- raise ValueError("Invalid attribute value: %s" %
- val_slug)
+ attr_val_pk = None
else:
- if attr_pk not in queries:
+ if attr_val_pk is not None and attr_pk not in queries:
queries[attr_pk] = [attr_val_pk]
else:
queries[attr_pk].append(attr_val_pk)