From d8bd09661ad9701ff7e3ecf15967374338bff7de Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 19 Jun 2024 20:30:54 -0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(flows.py):=20Add=20type?= =?UTF-8?q?=20ignore=20comments=20to=20suppress=20type=20checking=20errors?= =?UTF-8?q?=20for=20certain=20expressions.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/base/langflow/api/v1/flows.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/api/v1/flows.py b/src/backend/base/langflow/api/v1/flows.py index d2468932e..be074be07 100644 --- a/src/backend/base/langflow/api/v1/flows.py +++ b/src/backend/base/langflow/api/v1/flows.py @@ -56,14 +56,14 @@ def create_flow( ).first(): flows = session.exec( select(Flow) - .where(Flow.endpoint_name.like(f"{flow.endpoint_name}-%")) + .where(Flow.endpoint_name.like(f"{flow.endpoint_name}-%")) # type: ignore .where(Flow.user_id == current_user.id) ).all() if flows: # The endpoitn name is like "my-endpoint","my-endpoint-1", "my-endpoint-2" # so we need to get the highest number and add 1 # we need to get the last part of the endpoint name - numbers = [int(flow.endpoint_name.split("-")[-1]) for flow in flows] + numbers = [int(flow.endpoint_name.split("-")[-1]) for flow in flows] # type: ignore flow.endpoint_name = f"{flow.endpoint_name}-{max(numbers) + 1}" else: flow.endpoint_name = f"{flow.endpoint_name}-1"