@@ -60,18 +60,18 @@ def get_config():
6060@router .post ("/update" , response_model = response .UpdateWorkflows )
6161def update_workflows ():
6262 chat_config_path = Path (CHAT_DIR ) / CHAT_CONFIG_FILENAME
63-
63+
6464 if chat_config_path .exists ():
6565 with open (chat_config_path , "r" , encoding = "utf-8" ) as file :
6666 chat_config = yaml .safe_load (file )
67-
67+
6868 providers = chat_config .get ("providers" , {})
6969 devchat_api_key = providers .get ("devchat" , {}).get ("api_key" , "" )
7070 openai_api_key = providers .get ("openai" , {}).get ("api_key" , "" )
71-
71+
7272 if devchat_api_key or openai_api_key :
7373 update_public_workflow = chat_config .get ("update_public_workflow" , True )
74-
74+
7575 if update_public_workflow :
7676 base_path = Path (WORKFLOWS_BASE )
7777
@@ -84,11 +84,19 @@ def update_workflows():
8484
8585 return response .UpdateWorkflows (updated = updated , message = message )
8686 else :
87- return response .UpdateWorkflows (updated = False , message = "Workflow update has been ignored due to configuration settings." )
87+ return response .UpdateWorkflows (
88+ updated = False ,
89+ message = "Workflow update has been ignored due to configuration settings." ,
90+ )
8891 else :
89- return response .UpdateWorkflows (updated = False , message = "No valid API key found, workflow update ignored." )
92+ return response .UpdateWorkflows (
93+ updated = False , message = "No valid API key found, workflow update ignored."
94+ )
9095 else :
91- return response .UpdateWorkflows (updated = False , message = "Configuration file not found, workflow update ignored." )
96+ return response .UpdateWorkflows (
97+ updated = False , message = "Configuration file not found, workflow update ignored."
98+ )
99+
92100
93101@router .post ("/custom_update" , response_model = response .UpdateWorkflows )
94102def update_custom_workflows ():
0 commit comments