From 9811b97908e7368be9c3a6a83b133cf83feab3a0 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 21 Jul 2023 08:56:34 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(base.py):=20fix=20validation?= =?UTF-8?q?=20logic=20in=20=5Fvalidate=5Fnodes=20method=20to=20handle=20ca?= =?UTF-8?q?se=20when=20there=20is=20only=20one=20node=20in=20the=20graph?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/custom/custom_component.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index 233d99186..b03e8a560 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -133,8 +133,8 @@ class CustomComponent(Component): def load_flow(self, flow_id: UUID = None): from langflow.processing.process import build_sorted_vertices_with_caching - with get_session() as session: - data_graph = flow.data if (flow := session.get(Flow, flow_id)) else None + session = next(get_session()) + data_graph = flow.data if (flow := session.get(Flow, flow_id)) else None if not data_graph: raise ValueError(f"Flow {flow_id} not found") return build_sorted_vertices_with_caching(data_graph)