From 268c2eb452c6a3ca8c6505a17ebfbf235ca57233 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 10 Jan 2025 03:46:16 +0100 Subject: [PATCH] Implemented code to come solution nearer --- app/utils/configuration_resolver.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/utils/configuration_resolver.py b/app/utils/configuration_resolver.py index 1f0764d..380fb38 100644 --- a/app/utils/configuration_resolver.py +++ b/app/utils/configuration_resolver.py @@ -27,7 +27,14 @@ class ConfigurationResolver: if isinstance(current_config, dict): # Traverse all key-value pairs in the dictionary for key, value in list(current_config.items()): - if key == "link": + if key == "subitems" and isinstance(value, list): + # Überprüfen, ob die relevanten Subitems enthalten sind + subitems_to_promote = [item for item in value if item.get("link")] + if subitems_to_promote: + # Füge nur die relevanten Subitems direkt ein + current_config[key] = subitems_to_promote + + elif key == "link": # Found a `link` entry, attempt to resolve it try: print(f"Resolving link '{value}' at path '{path}'") # Debugging