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,29 +1002,37 @@ def run_workflows(
 | 
				
			|||||||
            added = timezone.localtime(timezone.now())
 | 
					            added = timezone.localtime(timezone.now())
 | 
				
			||||||
            created = timezone.localtime(overrides.created)
 | 
					            created = timezone.localtime(overrides.created)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        subject = parse_w_workflow_placeholders(
 | 
					        subject = (
 | 
				
			||||||
            action.email.subject,
 | 
					            parse_w_workflow_placeholders(
 | 
				
			||||||
            correspondent,
 | 
					                action.email.subject,
 | 
				
			||||||
            document_type,
 | 
					                correspondent,
 | 
				
			||||||
            owner_username,
 | 
					                document_type,
 | 
				
			||||||
            added,
 | 
					                owner_username,
 | 
				
			||||||
            filename,
 | 
					                added,
 | 
				
			||||||
            current_filename,
 | 
					                filename,
 | 
				
			||||||
            created,
 | 
					                current_filename,
 | 
				
			||||||
            title,
 | 
					                created,
 | 
				
			||||||
            doc_url,
 | 
					                title,
 | 
				
			||||||
 | 
					                doc_url,
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            if action.email.subject
 | 
				
			||||||
 | 
					            else ""
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        body = parse_w_workflow_placeholders(
 | 
					        body = (
 | 
				
			||||||
            action.email.body,
 | 
					            parse_w_workflow_placeholders(
 | 
				
			||||||
            correspondent,
 | 
					                action.email.body,
 | 
				
			||||||
            document_type,
 | 
					                correspondent,
 | 
				
			||||||
            owner_username,
 | 
					                document_type,
 | 
				
			||||||
            added,
 | 
					                owner_username,
 | 
				
			||||||
            filename,
 | 
					                added,
 | 
				
			||||||
            current_filename,
 | 
					                filename,
 | 
				
			||||||
            created,
 | 
					                current_filename,
 | 
				
			||||||
            title,
 | 
					                created,
 | 
				
			||||||
            doc_url,
 | 
					                title,
 | 
				
			||||||
 | 
					                doc_url,
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            if action.email.body
 | 
				
			||||||
 | 
					            else ""
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            n_messages = send_email(
 | 
					            n_messages = send_email(
 | 
				
			||||||
@@ -1105,7 +1113,7 @@ def run_workflows(
 | 
				
			|||||||
                            f"Error occurred parsing webhook params: {e}",
 | 
					                            f"Error occurred parsing webhook params: {e}",
 | 
				
			||||||
                            extra={"group": logging_group},
 | 
					                            extra={"group": logging_group},
 | 
				
			||||||
                        )
 | 
					                        )
 | 
				
			||||||
            else:
 | 
					            elif action.webhook.body:
 | 
				
			||||||
                data = parse_w_workflow_placeholders(
 | 
					                data = parse_w_workflow_placeholders(
 | 
				
			||||||
                    action.webhook.body,
 | 
					                    action.webhook.body,
 | 
				
			||||||
                    correspondent,
 | 
					                    correspondent,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user