Add more comments about source parsing

This commit is contained in:
2023-02-10 07:20:36 +00:00
parent 7d0ebf87bd
commit 2050e6cb47
2 changed files with 13 additions and 0 deletions

View File

@@ -542,6 +542,10 @@ class ElasticsearchBackend(StorageBackend):
total_sources = (
len(settings.MAIN_SOURCES) - 1 + len(settings.SOURCES_RESTRICTED)
)
# If the sources the user has access to are equal to all
# possible sources, then we don't need to add the source
# filter to the query.
if total_count != total_sources:
add_top_tmp = {"bool": {"should": []}}
for source_iter in sources: