From cdfefe5a63d54cca50718542d616593c175914d5 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 10 Jan 2025 02:39:33 +0100 Subject: [PATCH] Refactored code --- app/utils/configuration_resolver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/utils/configuration_resolver.py b/app/utils/configuration_resolver.py index 0e97abd..1f0764d 100644 --- a/app/utils/configuration_resolver.py +++ b/app/utils/configuration_resolver.py @@ -74,6 +74,7 @@ class ConfigurationResolver: KeyError: If the path cannot be resolved. ValueError: If the resolved entry is not of the expected type. """ + print(f"Current path being resolved: {path}") parts = path.split('.') # Split the path into segments current = config @@ -115,9 +116,8 @@ class ConfigurationResolver: ) # Stop navigating into `subitems` unless explicitly required by the path - if isinstance(current, dict) and "subitems" in current and isinstance(current["subitems"], list): - if part != "subitems": - break # Stop navigation if `subitems` is not explicitly in the path + if isinstance(current, dict) and "subitems" in current and isinstance(current["subitems"], list) and part != "subitems": + break # Stop navigation if `subitems` is not explicitly in the path # Ensure the resolved target is a dictionary or string if not isinstance(current, (dict, str)):