fix: handle case where tweak values are nested dicts (#3349)

This commit is contained in:
Ítalo Johnny 2024-08-15 08:36:30 -03:00 committed by GitHub
commit 93537933c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -137,8 +137,13 @@ def apply_tweaks(node: Dict[str, Any], node_tweaks: Dict[str, Any]) -> None:
if tweak_name not in template_data:
continue
if tweak_name in template_data:
key = "file_path" if template_data[tweak_name]["type"] == "file" else "value"
template_data[tweak_name][key] = tweak_value
if isinstance(tweak_value, dict):
for k, v in tweak_value.items():
k = "file_path" if template_data[tweak_name]["type"] == "file" else k
template_data[tweak_name][k] = v
else:
key = "file_path" if template_data[tweak_name]["type"] == "file" else "value"
template_data[tweak_name][key] = tweak_value
def apply_tweaks_on_vertex(vertex: Vertex, node_tweaks: Dict[str, Any]) -> None: