changed a few things with the mail rule admin.

This commit is contained in:
Jonas Winkler 2020-11-22 11:42:17 +01:00
parent 388e5b56de
commit 172b37239f
2 changed files with 29 additions and 8 deletions

View File

@ -0,0 +1,23 @@
# Generated by Django 3.1.3 on 2020-11-22 10:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('paperless_mail', '0004_mailrule_order'),
]
operations = [
migrations.AlterField(
model_name='mailrule',
name='action',
field=models.PositiveIntegerField(choices=[(3, "Mark as read, don't process read mails"), (4, "Flag the mail, don't process flagged mails"), (2, 'Move to specified folder'), (1, 'Delete')], default=3),
),
migrations.AlterField(
model_name='mailrule',
name='maximum_age',
field=models.PositiveIntegerField(default=30, help_text='Specified in days.'),
),
]

View File

@ -46,10 +46,10 @@ class MailRule(models.Model):
ACTION_FLAG = 4
ACTIONS = (
(ACTION_DELETE, "Delete"),
(ACTION_MOVE, "Move to specified folder"),
(ACTION_MARK_READ, "Mark as read, don't process read mails"),
(ACTION_FLAG, "Flag the mail, don't process flagged mails")
(ACTION_FLAG, "Flag the mail, don't process flagged mails"),
(ACTION_MOVE, "Move to specified folder"),
(ACTION_DELETE, "Delete"),
)
TITLE_FROM_SUBJECT = 1
@ -92,15 +92,13 @@ class MailRule(models.Model):
filter_subject = models.CharField(max_length=256, null=True, blank=True)
filter_body = models.CharField(max_length=256, null=True, blank=True)
maximum_age = models.PositiveIntegerField(default=30)
maximum_age = models.PositiveIntegerField(
default=30,
help_text="Specified in days.")
action = models.PositiveIntegerField(
choices=ACTIONS,
default=ACTION_MARK_READ,
help_text="The action applied to the mail. This action is only "
"performed when documents were consumed from the mail. "
"Mails without attachments will remain entirely "
"untouched."
)
action_parameter = models.CharField(