A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fix: handle null workflow body and email subject (#9271)
shamoon16f17829b619
diff --git a/src/documents/signals/handlers.py b/src/documents/signals/handlers.pyindex 78d0043b5..1fd34dd81 100644--- a/src/documents/signals/handlers.py+++ b/src/documents/signals/handlers.py@@ -1002,29 +1002,37 @@ def run_workflows(added = timezone.localtime(timezone.now())created = timezone.localtime(overrides.created)- subject = parse_w_workflow_placeholders(- action.email.subject,- correspondent,- document_type,- owner_username,- added,- filename,- current_filename,- created,- title,- doc_url,+ subject = (+ parse_w_workflow_placeholders(+ action.email.subject,+ correspondent,+ document_type,+ owner_username,+ added,+ filename,+ current_filename,+ created,+ title,+ doc_url,+ )+ if action.email.subject+ else "")- body = parse_w_workflow_placeholders(- action.email.body,- correspondent,- document_type,- owner_username,- added,- filename,- current_filename,- created,- title,- doc_url,+ body = (+ parse_w_workflow_placeholders(+ action.email.body,+ correspondent,+ document_type,+ owner_username,+ added,+ filename,+ current_filename,+ created,+ title,+ doc_url,+ )+ if action.email.body+ else "")try:n_messages = send_email(@@ -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,