mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-03 12:09:46 +01:00
Working mail rule & account edit
This commit is contained in:
parent
997bff4917
commit
18ad9bcbf2
6 changed files with 72 additions and 47 deletions
|
|
@ -716,7 +716,17 @@ class MailAccountSerializer(serializers.ModelSerializer):
|
|||
return mail_account
|
||||
|
||||
|
||||
class AccountField(serializers.PrimaryKeyRelatedField):
|
||||
def get_queryset(self):
|
||||
return MailAccount.objects.all()
|
||||
|
||||
|
||||
class MailRuleSerializer(serializers.ModelSerializer):
|
||||
account = AccountField(allow_null=True)
|
||||
assign_correspondent = CorrespondentField(allow_null=True)
|
||||
assign_tags = TagsField(many=True)
|
||||
assign_document_type = DocumentTypeField(allow_null=True)
|
||||
|
||||
class Meta:
|
||||
model = MailRule
|
||||
depth = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue