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

View File

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