Fix: handle null workflow body and email subject (#9271)

This commit is contained in:
shamoon 2025-03-01 15:44:52 -08:00 committed by GitHub
parent 3cf1c04a83
commit 16f17829b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1002,7 +1002,8 @@ def run_workflows(
added = timezone.localtime(timezone.now())
created = timezone.localtime(overrides.created)
subject = parse_w_workflow_placeholders(
subject = (
parse_w_workflow_placeholders(
action.email.subject,
correspondent,
document_type,
@ -1014,7 +1015,11 @@ def run_workflows(
title,
doc_url,
)
body = parse_w_workflow_placeholders(
if action.email.subject
else ""
)
body = (
parse_w_workflow_placeholders(
action.email.body,
correspondent,
document_type,
@ -1026,6 +1031,9 @@ def run_workflows(
title,
doc_url,
)
if action.email.body
else ""
)
try:
n_messages = send_email(
subject=subject,
@ -1105,7 +1113,7 @@ def run_workflows(
f"Error occurred parsing webhook params: {e}",
extra={"group": logging_group},
)
else:
elif action.webhook.body:
data = parse_w_workflow_placeholders(
action.webhook.body,
correspondent,