mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Fix: handle null workflow body and email subject (#9271)
This commit is contained in:
		@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user