Skip to content

Commit 585b213

Browse files
committed
exclude locations of killed items
1 parent 34ec3dc commit 585b213

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

newsroom/agenda/views.py

+8
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,14 @@ def gen_agg_terms(field: str):
346346
# Start with an empty aggregation structure
347347
es_query = {"size": 0, "aggs": {}}
348348

349+
# Exclude agenda items where state is "killed"
350+
es_query["query"] = {
351+
"bool": {
352+
"must_not": [{"term": {"state": "killed"}}],
353+
"filter": [],
354+
},
355+
}
356+
349357
# Conditionally add aggregations based on configuration
350358
if location_filter_options.get("city", True):
351359
es_query["aggs"]["city_search_country"] = {

0 commit comments

Comments
 (0)