A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Ensure dates from emails are made timezone aware if not already
Trenton Hdb02d5eff03c
diff --git a/src/paperless_mail/mail.py b/src/paperless_mail/mail.pyindex 355ad4b63..e90ad46eb 100644--- a/src/paperless_mail/mail.py+++ b/src/paperless_mail/mail.py@@ -19,6 +19,8 @@ from celery import shared_taskfrom celery.canvas import Signaturefrom django.conf import settingsfrom django.db import DatabaseError+from django.utils.timezone import is_naive+from django.utils.timezone import make_awarefrom documents.loggers import LoggingMixinfrom documents.models import Correspondentfrom documents.parsers import is_mime_type_supported@@ -236,6 +238,10 @@ def apply_mail_action(rule = MailRule.objects.get(pk=rule_id)account = MailAccount.objects.get(pk=rule.account.pk)+ # Ensure the date is properly timezone aware+ if is_naive(message_date):+ message_date = make_aware(message_date)+try:action = get_rule_action(rule)diff --git a/src/paperless_mail/tests/test_mail.py b/src/paperless_mail/tests/test_mail.pyindex 5e9b654fb..d4b844ff7 100644--- a/src/paperless_mail/tests/test_mail.py+++ b/src/paperless_mail/tests/test_mail.py@@ -1,6 +1,5 @@import dataclassesimport email.contentmanager-import osimport randomimport uuidfrom collections import namedtuple