🐛 fix(base.py): remove unused process_flow function call in Graph class to improve code readability and performance

🐛 fix(utils.py): change condition from `node["data"]["node"]["flow"]` to `node["data"]["node"].get("flow")` to handle cases where "flow" key is missing in node data

🐛 fix(utils.py): fix incorrect variable name in get_updated_edges function, change `new_edge` to `edge` in the condition
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-10-04 20:45:29 -03:00
commit 20555a4e88
2 changed files with 2 additions and 3 deletions

View file

@ -45,7 +45,6 @@ class Graph:
"""
if "data" in payload:
payload = payload["data"]
payload = process_flow(payload)
try:
nodes = payload["nodes"]
edges = payload["edges"]

View file

@ -152,7 +152,7 @@ def set_new_target_handle(proxy_id, new_edge, target_handle, node):
"type": _type,
"id": proxy_id,
}
if node["data"]["node"]["flow"]:
if node["data"]["node"].get("flow"):
new_target_handle["proxy"] = {
"field": node["data"]["node"]["template"][field]["proxy"]["field"],
"id": node["data"]["node"]["template"][field]["proxy"]["id"],
@ -203,6 +203,6 @@ def get_updated_edges(base_flow, g_nodes, group_node_id):
if new_edge["source"] == group_node_id:
new_edge = update_source_handle(new_edge, g_nodes)
if new_edge["target"] == group_node_id or new_edge["source"] == group_node_id:
if edge["target"] == group_node_id or edge["source"] == group_node_id:
updated_edges.append(new_edge)
return updated_edges