Don't add sources to query if we are allowed to see them all

This commit is contained in:
2022-09-05 07:20:30 +01:00
parent 667e4c475f
commit 02e1b4698d
2 changed files with 481 additions and 477 deletions

View File

@@ -162,9 +162,13 @@ def query_results(
sources.append(source_iter)
add_top_tmp = {"bool": {"should": []}}
total_count = 0
for source_iter in sources:
add_top_tmp["bool"]["should"].append({"equals": {"src": source_iter}})
add_top.append(add_top_tmp)
total_count += 1
total_sources = len(settings.MANTICORE_MAIN_SOURCES) + len(settings.MANTICORE_SOURCES_RESTRICTED)
if not total_count == total_sources:
add_top.append(add_top_tmp)
# Date/time range
if set({"from_date", "to_date", "from_time", "to_time"}).issubset(