mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
Implement debug_mode for email delivery (vibe-kanban f32190a0)
The EmailDeliveryConfig in api/core/workflow/nodes/human\_input/entities.py has a field `debug_mode`. When this field is set to `True` in `node_data`, the test run (InvokeFrom.DEBUGGER) and the delivery test should only sent test emails to the current user, instead of sending to the specified recipients. Please implement this logic, write correspond test cases to ensure that the logic works as expected.
This commit is contained in:
@ -27,6 +27,7 @@ from core.workflow.nodes.base.node import Node
|
||||
from core.workflow.nodes.human_input.entities import (
|
||||
DeliveryChannelConfig,
|
||||
HumanInputNodeData,
|
||||
apply_debug_email_recipient,
|
||||
validate_human_input_submission,
|
||||
)
|
||||
from core.workflow.nodes.human_input.human_input_node import HumanInputNode
|
||||
@ -918,6 +919,11 @@ class WorkflowService:
|
||||
raise ValueError("Delivery method not found.")
|
||||
if not delivery_method.enabled:
|
||||
raise ValueError("Delivery method is disabled.")
|
||||
delivery_method = apply_debug_email_recipient(
|
||||
delivery_method,
|
||||
enabled=True,
|
||||
user_id=account.id or "",
|
||||
)
|
||||
|
||||
rendered_content = self._render_human_input_content_for_test(
|
||||
app_model=app_model,
|
||||
|
||||
Reference in New Issue
Block a user