From 0a132c6e3a2f4b750ad66025b189f6f16ee28d24 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Fri, 9 Dec 2022 07:20:59 +0000 Subject: [PATCH] Fix deduplication function --- core/db/__init__.py | 1 + core/db/druid.py | 2 +- core/db/elastic.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/db/__init__.py b/core/db/__init__.py index 19f9a8d..4a45e9d 100644 --- a/core/db/__init__.py +++ b/core/db/__init__.py @@ -334,6 +334,7 @@ class StorageBackend(ABC): if not dedup_fields: dedup_fields = ["msg", "nick", "ident", "host", "net", "channel"] response = helpers.dedup_list(response, dedup_fields) + return response @abstractmethod def parse(self, response): diff --git a/core/db/druid.py b/core/db/druid.py index 3f8c8b5..158f16f 100644 --- a/core/db/druid.py +++ b/core/db/druid.py @@ -227,7 +227,7 @@ class DruidBackend(StorageBackend): response = self.query(request.user, search_query) # A/D/R - Annotate/Dedup/Reverse - self.process_results( + response = self.process_results( response, annotate=annotate, dedup=dedup, diff --git a/core/db/elastic.py b/core/db/elastic.py index 13b6a44..13cd018 100644 --- a/core/db/elastic.py +++ b/core/db/elastic.py @@ -325,7 +325,7 @@ class ElasticsearchBackend(StorageBackend): return response # A/D/R - Annotate/Dedup/Reverse - self.process_results( + response["object_list"] = self.process_results( response["object_list"], annotate=annotate, dedup=dedup,