From 05df7511327439f44ac3aebdaaf8e3088a823611 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 11 Dec 2023 21:46:01 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(utils.py):=20check=20if=20va?= =?UTF-8?q?lue=5Fdict["value"]=20and=20value=5Fdict["file=5Fpath"]=20are?= =?UTF-8?q?=20truthy=20before=20updating=20template=20field=20value=20and?= =?UTF-8?q?=20file=20path=20value=20respectively?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/api/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/api/utils.py b/src/backend/langflow/api/utils.py index b7b893dda..8921cdb6e 100644 --- a/src/backend/langflow/api/utils.py +++ b/src/backend/langflow/api/utils.py @@ -110,10 +110,10 @@ def update_template_field(frontend_template, key, value_dict): if not template_field or template_field.get("type") != value_dict.get("type"): return - if "value" in value_dict: + if "value" in value_dict and value_dict["value"]: template_field["value"] = value_dict["value"] - if "file_path" in value_dict: + if "file_path" in value_dict and value_dict["file_path"]: file_path_value = get_file_path_value(value_dict["file_path"]) if not file_path_value: # If the file does not exist, remove the value from the template_field["value"]