refactor(console): use walk_nodes for trigger detection; remove unused import

This commit is contained in:
fisher 2025-12-02 15:11:37 +08:00
parent e8d00d86bf
commit 02a0b1ca87
2 changed files with 3 additions and 6 deletions

View File

@ -324,11 +324,8 @@ class AppListApi(Resource):
NodeType.TRIGGER_PLUGIN,
}
for workflow in draft_workflows:
graph = workflow.graph_dict
nodes = graph.get("nodes", [])
for node in nodes:
node_type = node.get("data", {}).get("type")
if node_type in trigger_node_types:
for node_type in trigger_node_types:
if next(workflow.walk_nodes(node_type), None):
draft_trigger_app_ids.add(str(workflow.app_id))
break

View File

@ -36,7 +36,7 @@ from factories.variable_factory import TypeMismatchError, build_segment_with_typ
from libs.datetime_utils import naive_utc_now
from libs.uuid_utils import uuidv7
from ._workflow_exc import NodeNotFoundError, WorkflowDataError
from ._workflow_exc import NodeNotFoundError
if TYPE_CHECKING:
from .model import AppMode, UploadFile