diff --git a/core/lib/meta.py b/core/lib/meta.py index 76e50de..231518e 100644 --- a/core/lib/meta.py +++ b/core/lib/meta.py @@ -37,17 +37,20 @@ def get_meta(request, net, nicks, iter=True): """ # Split query into chunks - split_nicks = array_split( - nicks, ceil(len(nicks) / settings.META_MAX_CHUNK_SIZE) - ) + split_nicks = array_split(nicks, ceil(len(nicks) / settings.META_MAX_CHUNK_SIZE)) meta = [] for nicks_chunked in split_nicks: if len(nicks_chunked) == 0: break meta_tmp = [] query = construct_query(net, nicks_chunked) - results = run_main_query(client, request.user, query, - custom_query=True, index=settings.OPENSEARCH_INDEX_META) + results = run_main_query( + client, + request.user, + query, + custom_query=True, + index=settings.OPENSEARCH_INDEX_META, + ) if "hits" in results.keys(): if "hits" in results["hits"]: for item in results["hits"]["hits"]: diff --git a/core/lib/opensearch.py b/core/lib/opensearch.py index bd9e9d5..ec37647 100644 --- a/core/lib/opensearch.py +++ b/core/lib/opensearch.py @@ -169,10 +169,9 @@ def query_results(request, size=None): def query_single_result(request): context = query_results(request, 1) dedup_set = {item["nick"] for item in context["results"]} - if len(dedup_set) == 1: + if dedup_set: context["item"] = context["results"][0] - else: - return (len(dedup_set), context) + return (1, context) diff --git a/core/templates/ui/insights/info.html b/core/templates/ui/insights/info.html index 9a9d84c..535b515 100644 --- a/core/templates/ui/insights/info.html +++ b/core/templates/ui/insights/info.html @@ -18,15 +18,6 @@ hx-target="#nicks" hx-swap="outerHTML"> -