Fix dedup

This commit is contained in:
Mark Veidemanis 2022-12-09 07:20:28 +00:00
parent 5fdd5121eb
commit bd8b995134
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 10 additions and 1 deletions

View File

@ -330,7 +330,8 @@ class StorageBackend(ABC):
if kwargs.get("reverse"):
response.reverse()
if kwargs.get("dedup"):
if not kwargs.get("dedup_fields"):
dedup_fields = kwargs.get("dedup_fields")
if not dedup_fields:
dedup_fields = ["msg", "nick", "ident", "host", "net", "channel"]
response = helpers.dedup_list(response, dedup_fields)

View File

@ -173,6 +173,14 @@ class DrilldownTableView(SingleTableView):
tags = parse_tags(query_params["tags"])
extra_params["tags"] = tags
if "dedup" in query_params:
if query_params["dedup"] == "on":
extra_params["dedup"] = True
else:
extra_params["dedup"] = False
else:
extra_params["dedup"] = False
context = db.query_results(request, query_params, **extra_params)
# Unique is for identifying the widgets.