mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 12:37:20 +08:00
fix bugs
This commit is contained in:
parent
f803fb5855
commit
0b07c6914a
@ -51,7 +51,7 @@ class AppParameterApi(InstalledAppResource):
|
|||||||
raise AppUnavailableError()
|
raise AppUnavailableError()
|
||||||
|
|
||||||
features_dict = workflow.features_dict
|
features_dict = workflow.features_dict
|
||||||
user_input_form = workflow.user_input_form()
|
user_input_form = workflow.user_input_form(to_old_structure=True)
|
||||||
else:
|
else:
|
||||||
app_model_config = app_model.app_model_config
|
app_model_config = app_model.app_model_config
|
||||||
features_dict = app_model_config.to_dict()
|
features_dict = app_model_config.to_dict()
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class AppParameterApi(Resource):
|
|||||||
raise AppUnavailableError()
|
raise AppUnavailableError()
|
||||||
|
|
||||||
features_dict = workflow.features_dict
|
features_dict = workflow.features_dict
|
||||||
user_input_form = workflow.user_input_form()
|
user_input_form = workflow.user_input_form(to_old_structure=True)
|
||||||
else:
|
else:
|
||||||
app_model_config = app_model.app_model_config
|
app_model_config = app_model.app_model_config
|
||||||
features_dict = app_model_config.to_dict()
|
features_dict = app_model_config.to_dict()
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class AppParameterApi(WebApiResource):
|
|||||||
raise AppUnavailableError()
|
raise AppUnavailableError()
|
||||||
|
|
||||||
features_dict = workflow.features_dict
|
features_dict = workflow.features_dict
|
||||||
user_input_form = workflow.user_input_form()
|
user_input_form = workflow.user_input_form(to_old_structure=True)
|
||||||
else:
|
else:
|
||||||
app_model_config = app_model.app_model_config
|
app_model_config = app_model.app_model_config
|
||||||
features_dict = app_model_config.to_dict()
|
features_dict = app_model_config.to_dict()
|
||||||
|
|||||||
@ -129,7 +129,7 @@ class Workflow(db.Model):
|
|||||||
def features_dict(self):
|
def features_dict(self):
|
||||||
return json.loads(self.features) if self.features else {}
|
return json.loads(self.features) if self.features else {}
|
||||||
|
|
||||||
def user_input_form(self) -> list:
|
def user_input_form(self, to_old_structure: bool = False) -> list:
|
||||||
# get start node from graph
|
# get start node from graph
|
||||||
if not self.graph:
|
if not self.graph:
|
||||||
return []
|
return []
|
||||||
@ -143,8 +143,18 @@ class Workflow(db.Model):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
# get user_input_form from start node
|
# get user_input_form from start node
|
||||||
return start_node.get('data', {}).get('variables', [])
|
variables = start_node.get('data', {}).get('variables', [])
|
||||||
|
|
||||||
|
if to_old_structure:
|
||||||
|
old_structure_variables = []
|
||||||
|
for variable in variables:
|
||||||
|
old_structure_variables.append({
|
||||||
|
variable['type']: variable
|
||||||
|
})
|
||||||
|
|
||||||
|
return old_structure_variables
|
||||||
|
|
||||||
|
return variables
|
||||||
|
|
||||||
class WorkflowRunTriggeredFrom(Enum):
|
class WorkflowRunTriggeredFrom(Enum):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user