Allow duplicate tag keys

master
Mark Veidemanis 2 years ago
parent 8010ebf2c1
commit 835be7e001
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -110,8 +110,9 @@ class StorageBackend(object):
if not query_created: if not query_created:
search_query = self.construct_query(None, size, index, blank=True) search_query = self.construct_query(None, size, index, blank=True)
query_created = True query_created = True
for tagname, tagvalue in tags.items(): for item in tags:
add_bool.append({tagname: tagvalue}) for tagname, tagvalue in item.items():
add_bool.append({tagname: tagvalue})
valid = self.check_valid_query(query_params, custom_query) valid = self.check_valid_query(query_params, custom_query)
if isinstance(valid, dict): if isinstance(valid, dict):

@ -60,14 +60,14 @@ def parse_tags(tags_pre):
""" """
Parse the tags from the variable tags_pre. Parse the tags from the variable tags_pre.
""" """
tags = {} tags = []
tags_spl = tags_pre.split(",") tags_spl = tags_pre.split(",")
if tags_spl: if tags_spl:
for tag in tags_spl: for tag in tags_spl:
tag = tag.split(": ") tag = tag.split(": ")
if len(tag) == 2: if len(tag) == 2:
key, val = tag key, val = tag
tags[key] = val tags.append({key: val})
return tags return tags

Loading…
Cancel
Save