mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-10-12 02:26:09 -05:00
Allow setting more than one tag in mail rules
The three migrations do the following to preserve existing data in assign_tag: 1. Add the new many-to-many field assign_tags. 2. Copy existing data from the assign_tag field to the assign_tags. 3. Delete the existing assign_tag field.
This commit is contained in:
@@ -265,7 +265,7 @@ class MailAccountHandler(LoggingMixin):
|
||||
)
|
||||
|
||||
correspondent = self.get_correspondent(message, rule)
|
||||
tag = rule.assign_tag
|
||||
tag_ids = [tag.id for tag in rule.assign_tags.all()]
|
||||
doc_type = rule.assign_document_type
|
||||
|
||||
processed_attachments = 0
|
||||
@@ -328,7 +328,7 @@ class MailAccountHandler(LoggingMixin):
|
||||
if correspondent
|
||||
else None,
|
||||
override_document_type_id=doc_type.id if doc_type else None,
|
||||
override_tag_ids=[tag.id] if tag else None,
|
||||
override_tag_ids=tag_ids,
|
||||
task_name=att.filename[:100],
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user