mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-10 05:01:28 +00:00
Infer overrides
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user