mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 01:26:33 +08:00
refactor(console): use walk_nodes for trigger detection; remove unused import
This commit is contained in:
parent
e8d00d86bf
commit
02a0b1ca87
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user