From 835be7e001e9f116c60a8b6cf1c1ee0ff39ea85a Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Fri, 30 Sep 2022 07:22:22 +0100 Subject: [PATCH] Allow duplicate tag keys --- core/db/__init__.py | 5 +++-- core/views/ui/drilldown.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/db/__init__.py b/core/db/__init__.py index 0f51172..a93eb33 100644 --- a/core/db/__init__.py +++ b/core/db/__init__.py @@ -110,8 +110,9 @@ class StorageBackend(object): if not query_created: search_query = self.construct_query(None, size, index, blank=True) query_created = True - for tagname, tagvalue in tags.items(): - add_bool.append({tagname: tagvalue}) + for item in tags: + for tagname, tagvalue in item.items(): + add_bool.append({tagname: tagvalue}) valid = self.check_valid_query(query_params, custom_query) if isinstance(valid, dict): diff --git a/core/views/ui/drilldown.py b/core/views/ui/drilldown.py index 3e7d4f8..db1f06c 100644 --- a/core/views/ui/drilldown.py +++ b/core/views/ui/drilldown.py @@ -60,14 +60,14 @@ def parse_tags(tags_pre): """ Parse the tags from the variable tags_pre. """ - tags = {} + tags = [] tags_spl = tags_pre.split(",") if tags_spl: for tag in tags_spl: tag = tag.split(": ") if len(tag) == 2: key, val = tag - tags[key] = val + tags.append({key: val}) return tags