diff --git a/src-ui/src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html b/src-ui/src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html
index 807df18c5..8164fca9a 100644
--- a/src-ui/src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html
+++ b/src-ui/src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html
@@ -9,7 +9,7 @@
diff --git a/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html b/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html
index 3eb793ae2..dc4260ffd 100644
--- a/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html
+++ b/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html
@@ -8,7 +8,6 @@
-
diff --git a/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts b/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts
index 22b5df542..7644ed353 100644
--- a/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts
+++ b/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts
@@ -64,7 +64,6 @@ export class MailRuleEditDialogComponent extends EditDialogComponent
Mail accounts
-
+
@@ -264,7 +269,12 @@
Mail rules
-
+
diff --git a/src-ui/src/app/components/manage/settings/settings.component.ts b/src-ui/src/app/components/manage/settings/settings.component.ts
index fbb41b972..3a146fb36 100644
--- a/src-ui/src/app/components/manage/settings/settings.component.ts
+++ b/src-ui/src/app/components/manage/settings/settings.component.ts
@@ -266,7 +266,6 @@ export class SettingsComponent
for (let rule of this.mailRules) {
storeData.mailRules[rule.id.toString()] = {
name: rule.name,
- order: rule.order,
account: rule.account,
folder: rule.folder,
filter_from: rule.filter_from,
@@ -287,7 +286,6 @@ export class SettingsComponent
rule.id.toString(),
new FormGroup({
name: new FormControl(null),
- order: new FormControl(null),
account: new FormControl(null),
folder: new FormControl(null),
filter_from: new FormControl(null),
@@ -519,6 +517,7 @@ export class SettingsComponent
this.toastService.showInfo(
$localize`Saved account "${newMailAccount.name}".`
)
+ this.mailAccountService.clearCache()
this.mailAccountService.listAll().subscribe((r) => {
this.mailAccounts = r.results
this.initialize()
@@ -576,6 +575,7 @@ export class SettingsComponent
this.toastService.showInfo(
$localize`Saved rule "${newMailRule.name}".`
)
+ this.mailRuleService.clearCache()
this.mailRuleService.listAll().subscribe((r) => {
this.mailRules = r.results
diff --git a/src-ui/src/app/data/paperless-mail-rule.ts b/src-ui/src/app/data/paperless-mail-rule.ts
index ff6654a0b..9ff133dab 100644
--- a/src-ui/src/app/data/paperless-mail-rule.ts
+++ b/src-ui/src/app/data/paperless-mail-rule.ts
@@ -28,8 +28,6 @@ export enum MailMetadataCorrespondentOption {
export interface PaperlessMailRule extends ObjectWithId {
name: string
- order: number
-
account: number // PaperlessMailAccount.id
folder: string
diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py
index 6b78d1f89..44572e8fb 100644
--- a/src/documents/serialisers.py
+++ b/src/documents/serialisers.py
@@ -748,6 +748,7 @@ class MailRuleSerializer(serializers.ModelSerializer):
assign_correspondent = CorrespondentField(allow_null=True, required=False)
assign_tags = TagsField(many=True, allow_null=True, required=False)
assign_document_type = DocumentTypeField(allow_null=True, required=False)
+ order = serializers.IntegerField(required=False)
class Meta:
model = MailRule