mirror of https://github.com/langgenius/dify.git
fix bugs
This commit is contained in:
parent
f803fb5855
commit
0b07c6914a
|
|
@ -51,7 +51,7 @@ class AppParameterApi(InstalledAppResource):
|
|||
raise AppUnavailableError()
|
||||
|
||||
features_dict = workflow.features_dict
|
||||
user_input_form = workflow.user_input_form()
|
||||
user_input_form = workflow.user_input_form(to_old_structure=True)
|
||||
else:
|
||||
app_model_config = app_model.app_model_config
|
||||
features_dict = app_model_config.to_dict()
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class AppParameterApi(Resource):
|
|||
raise AppUnavailableError()
|
||||
|
||||
features_dict = workflow.features_dict
|
||||
user_input_form = workflow.user_input_form()
|
||||
user_input_form = workflow.user_input_form(to_old_structure=True)
|
||||
else:
|
||||
app_model_config = app_model.app_model_config
|
||||
features_dict = app_model_config.to_dict()
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class AppParameterApi(WebApiResource):
|
|||
raise AppUnavailableError()
|
||||
|
||||
features_dict = workflow.features_dict
|
||||
user_input_form = workflow.user_input_form()
|
||||
user_input_form = workflow.user_input_form(to_old_structure=True)
|
||||
else:
|
||||
app_model_config = app_model.app_model_config
|
||||
features_dict = app_model_config.to_dict()
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class Workflow(db.Model):
|
|||
def features_dict(self):
|
||||
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
|
||||
if not self.graph:
|
||||
return []
|
||||
|
|
@ -143,8 +143,18 @@ class Workflow(db.Model):
|
|||
return []
|
||||
|
||||
# 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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue