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