From d954e0ebbb5af1c831f4c7ebdcdf8e9e683557d8 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Sun, 29 Sep 2024 16:33:38 +0800 Subject: [PATCH] fix(node): correct conditional checks in list filter node - Added check for variable value before type checking in ListFilterNode to prevent unnecessary errors. - Fixed incorrect workflow feature path in AppDslService to ensure correct data fetching. --- api/core/workflow/nodes/list_filter/node.py | 2 +- api/services/app_dsl_service.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core/workflow/nodes/list_filter/node.py b/api/core/workflow/nodes/list_filter/node.py index d1e23c65ee3fb2..3b0dad76ce91e7 100644 --- a/api/core/workflow/nodes/list_filter/node.py +++ b/api/core/workflow/nodes/list_filter/node.py @@ -27,7 +27,7 @@ def _run(self): return NodeRunResult( status=WorkflowNodeExecutionStatus.FAILED, error=error_message, inputs=inputs, outputs=outputs ) - if not isinstance(variable, ArrayFileSegment | ArrayNumberSegment | ArrayStringSegment): + if variable.value and not isinstance(variable, ArrayFileSegment | ArrayNumberSegment | ArrayStringSegment): error_message = ( f"Variable {node_data.variable} is not an ArrayFileSegment, ArrayNumberSegment " "or ArrayStringSegment" ) diff --git a/api/services/app_dsl_service.py b/api/services/app_dsl_service.py index 510a29d15b3f2c..750d0a8cd28f88 100644 --- a/api/services/app_dsl_service.py +++ b/api/services/app_dsl_service.py @@ -265,7 +265,7 @@ def _import_and_create_new_workflow_based_app( draft_workflow = workflow_service.sync_draft_workflow( app_model=app, graph=workflow_data.get("graph", {}), - features=workflow_data.get("../core/app/features", {}), + features=workflow_data.get("features", {}), unique_hash=None, account=account, environment_variables=environment_variables,