fix: Handle attribute filter when no items found

This commit is contained in:
Faris Ansari 2019-05-06 15:59:51 +05:30
parent aa7ce883ed
commit ff9177a6ce

View File

@ -257,7 +257,8 @@ def get_items_with_selected_attributes(item_code, selected_attributes):
items = []
for attribute, value in selected_attributes.items():
items.append(set(attribute_value_item_map[(attribute, value)]))
filtered_items = attribute_value_item_map.get((attribute, value), [])
items.append(set(filtered_items))
return set.intersection(*items)