A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Handles the case where other might have a None field as well (#4598)
Trenton H07989bc2facd
diff --git a/src/documents/data_models.py b/src/documents/data_models.pyindex 7dcfe4401..29a23fa7a 100644--- a/src/documents/data_models.py+++ b/src/documents/data_models.py@@ -48,31 +48,32 @@ class DocumentMetadataOverrides:self.storage_path_id = other.storage_path_idif self.owner_id is None:self.owner_id = other.owner_id+# merge- # TODO: Handle the case where other is also Noneif self.tag_ids is None:self.tag_ids = other.tag_ids- else:+ elif other.tag_ids is not None:self.tag_ids.extend(other.tag_ids)+if self.view_users is None:self.view_users = other.view_users- else:+ elif other.view_users is not None:self.view_users.extend(other.view_users)+if self.view_groups is None:self.view_groups = other.view_groups- else:+ elif other.view_groups is not None:self.view_groups.extend(other.view_groups)+if self.change_users is None:self.change_users = other.change_users- else:+ elif other.change_users is not None:self.change_users.extend(other.change_users)+if self.change_groups is None:self.change_groups = other.change_groups- else:- self.change_groups = [- *self.change_groups,- *other.change_groups,- ]+ elif other.change_groups is not None:+ self.change_groups.extend(other.change_groups)return selfdiff --git a/src/paperless_mail/mail.py b/src/paperless_mail/mail.pyindex f3ebc35df..2179b8c90 100644--- a/src/paperless_mail/mail.py+++ b/src/paperless_mail/mail.py@@ -617,7 +617,7 @@ class MailAccountHandler(LoggingMixin):f"{len(message.attachments)} attachment(s)",)- tag_ids = [tag.id for tag in rule.assign_tags.all()]+ tag_ids: list[int] = [tag.id for tag in rule.assign_tags.all()]doc_type = rule.assign_document_typeif (