Added type for pop filter in tags
This commit is contained in:
parent
17d8db649b
commit
be96a6c7ba
|
|
@ -129,10 +129,19 @@ class FiltersTagCategoryViewSet(TagCategoryViewSet):
|
|||
|
||||
result_list.append(wine_regions)
|
||||
|
||||
item_types = {
|
||||
'pop': 'pop'
|
||||
}
|
||||
|
||||
for item in result_list:
|
||||
if 'filters' in item:
|
||||
item['filters'].sort(key=lambda x: x.get('label_translated'))
|
||||
|
||||
index_name = item.get('index_name')
|
||||
|
||||
if index_name in item_types:
|
||||
item['type'] = item_types[index_name]
|
||||
|
||||
if filter_flags['toque_number']:
|
||||
toques = {
|
||||
"index_name": "toque_number",
|
||||
|
|
@ -206,7 +215,7 @@ class FiltersTagCategoryViewSet(TagCategoryViewSet):
|
|||
result_list = [category for category in result_list if category.get('index_name') != 'tag']
|
||||
if len(tag_category):
|
||||
tag_category = list(filter(lambda x: x.get('index_name') == 'pop', tag_category[0]['filters']))
|
||||
if len(tag_category): # we have Pop tag in our results
|
||||
if len(tag_category): # we have Pop tag in our results
|
||||
tag_category = tag_category[0]
|
||||
tag_category['param_name'] = 'tags_id__in'
|
||||
result_list.append(tag_category)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user