A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fixes the logging of an email message to be something useful (#6901)
Trenton Hde7c22e8d66f
diff --git a/src/paperless_mail/mail.py b/src/paperless_mail/mail.pyindex 7d41590ad..50435de5d 100644--- a/src/paperless_mail/mail.py+++ b/src/paperless_mail/mail.py@@ -9,6 +9,7 @@ from datetime import datefrom datetime import timedeltafrom fnmatch import fnmatchfrom pathlib import Path+from typing import TYPE_CHECKINGfrom typing import Optionalfrom typing import Union@@ -584,12 +585,17 @@ class MailAccountHandler(LoggingMixin):total_processed_files = 0for message in messages:+ if TYPE_CHECKING:+ assert isinstance(message, MailMessage)+if ProcessedMail.objects.filter(rule=rule,uid=message.uid,folder=rule.folder,).exists():- self.log.debug(f"Skipping mail {message}, already processed.")+ self.log.debug(+ f"Skipping mail '{message.uid}' subject '{message.subject}' from '{message.from_}', already processed.",+ )continuetry:@@ -659,7 +665,7 @@ class MailAccountHandler(LoggingMixin):):processed_attachments = 0- consume_tasks = list()+ consume_tasks = []for att in message.attachments:if (