From 73bfa4e7b0d14b1a07dbeb5ff4a990f8ff50c6cd Mon Sep 17 00:00:00 2001 From: wl-zhao Date: Mon, 28 Oct 2024 15:13:01 +0800 Subject: [PATCH] add warning message when no inputs/outputs founded --- custom_routes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/custom_routes.py b/custom_routes.py index f3a6a91..b7718ee 100755 --- a/custom_routes.py +++ b/custom_routes.py @@ -158,13 +158,14 @@ async def shellagent_export(request): # for fname, dict_to_save in fname_mapping.items(): # with open(os.path.join(save_root, fname), "w") as f: # json.dump(dict_to_save, f, indent=2) - + warning_message = "" if dependency_results.get("black_list_nodes", []): warning_message = "The following nodes cannot be deployed to myshell:\n" for item in dependency_results["black_list_nodes"]: warning_message += f" {item['name']}: {item['reason']}\n" - else: - warning_message = "" + + if len(schemas["inputs"]) + len(schemas["outputs"]) == 0: + warning_message += f"The workflow contains neither inputs nor outputs!\n" return_dict = { "success": True,