From b57b486a2fb692e3e664e764dcc5e2c0f83c9948 Mon Sep 17 00:00:00 2001 From: Eduardo Lauer Date: Tue, 10 Sep 2024 15:14:12 -0300 Subject: [PATCH] add nested level in grouped_list if --- src/searchers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/searchers.py b/src/searchers.py index 9dc8afd..02fc750 100644 --- a/src/searchers.py +++ b/src/searchers.py @@ -103,7 +103,7 @@ def _group_by_department(search_results: dict, department: list) -> dict: for dept in department: if dept.casefold() in str(result["hierarchyList"]).casefold(): # Initialize the group if not present - if dept not in dpt_grouped_result: + if dept not in dpt_grouped_result[term]: dpt_grouped_result[term][dept] = [] dpt_grouped_result[term][dept].append(result) else: