Skip to content

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

Add if condition to search filter

Maciej Korycinski77f28b026723
diff --git a/saleor/graphql/product/filters.py b/saleor/graphql/product/filters.py
index c1d7f387d3..e142b4c37f 100644
--- a/saleor/graphql/product/filters.py
+++ b/saleor/graphql/product/filters.py
@@ -114,8 +114,9 @@ def filter_stock_availability(qs, _, value):
def filter_search(qs, _, value):
- search = picker.pick_backend()
- qs &= search(value)
+ if value:
+ search = picker.pick_backend()
+ qs &= search(value)
return qs