Infer overrides

This commit is contained in:
shamoon
2025-12-09 09:35:02 -08:00
parent 5a9c3f375e
commit a0108c1db5
2 changed files with 4 additions and 12 deletions

View File

@@ -738,11 +738,7 @@ def run_workflows(
)
continue
context = build_workflow_action_context(
document,
overrides,
use_overrides=use_overrides,
)
context = build_workflow_action_context(document, overrides)
execute_email_action(
action,
document,
@@ -752,11 +748,7 @@ def run_workflows(
trigger_type,
)
elif action.type == WorkflowAction.WorkflowActionType.WEBHOOK:
context = build_workflow_action_context(
document,
overrides,
use_overrides=use_overrides,
)
context = build_workflow_action_context(document, overrides)
execute_webhook_action(
action,
document,

View File

@@ -23,12 +23,12 @@ logger = logging.getLogger("paperless.workflows.actions")
def build_workflow_action_context(
document: Document | ConsumableDocument,
overrides: DocumentMetadataOverrides | None,
*,
use_overrides: bool = False,
) -> dict:
"""
Build context dictionary for workflow action placeholder parsing.
"""
use_overrides = overrides is not None
if not use_overrides:
return {
"title": document.title,