mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-10-12 02:26:09 -05:00
Format Python code with black
This commit is contained in:
@@ -15,9 +15,9 @@ class MailAccountAdminForm(forms.ModelForm):
|
||||
|
||||
model = MailAccount
|
||||
widgets = {
|
||||
'password': forms.PasswordInput(),
|
||||
"password": forms.PasswordInput(),
|
||||
}
|
||||
fields = '__all__'
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class MailAccountAdmin(admin.ModelAdmin):
|
||||
@@ -25,15 +25,9 @@ class MailAccountAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "imap_server", "username")
|
||||
|
||||
fieldsets = [
|
||||
(None, {
|
||||
'fields': ['name', 'imap_server', 'imap_port']
|
||||
}),
|
||||
(_("Authentication"), {
|
||||
'fields': ['imap_security', 'username', 'password']
|
||||
}),
|
||||
(_("Advanced settings"), {
|
||||
'fields': ['character_set']
|
||||
})
|
||||
(None, {"fields": ["name", "imap_server", "imap_port"]}),
|
||||
(_("Authentication"), {"fields": ["imap_security", "username", "password"]}),
|
||||
(_("Advanced settings"), {"fields": ["character_set"]}),
|
||||
]
|
||||
form = MailAccountAdminForm
|
||||
|
||||
@@ -44,56 +38,66 @@ class MailRuleAdmin(admin.ModelAdmin):
|
||||
"attachment_type": admin.VERTICAL,
|
||||
"action": admin.VERTICAL,
|
||||
"assign_title_from": admin.VERTICAL,
|
||||
"assign_correspondent_from": admin.VERTICAL
|
||||
"assign_correspondent_from": admin.VERTICAL,
|
||||
}
|
||||
|
||||
fieldsets = (
|
||||
(None, {
|
||||
'fields': ('name', 'order', 'account', 'folder')
|
||||
}),
|
||||
(_("Filter"), {
|
||||
'description':
|
||||
_("Paperless will only process mails that match ALL of the "
|
||||
"filters given below."),
|
||||
'fields':
|
||||
('filter_from',
|
||||
'filter_subject',
|
||||
'filter_body',
|
||||
'filter_attachment_filename',
|
||||
'maximum_age',
|
||||
'attachment_type')
|
||||
}),
|
||||
(_("Actions"), {
|
||||
'description':
|
||||
_("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."),
|
||||
'fields': (
|
||||
'action',
|
||||
'action_parameter')
|
||||
}),
|
||||
(_("Metadata"), {
|
||||
'description':
|
||||
_("Assign metadata to documents consumed from this rule "
|
||||
"automatically. If you do not assign tags, types or "
|
||||
"correspondents here, paperless will still process all "
|
||||
"matching rules that you have defined."),
|
||||
"fields": (
|
||||
'assign_title_from',
|
||||
'assign_tag',
|
||||
'assign_document_type',
|
||||
'assign_correspondent_from',
|
||||
'assign_correspondent')
|
||||
})
|
||||
(None, {"fields": ("name", "order", "account", "folder")}),
|
||||
(
|
||||
_("Filter"),
|
||||
{
|
||||
"description": _(
|
||||
"Paperless will only process mails that match ALL of the "
|
||||
"filters given below."
|
||||
),
|
||||
"fields": (
|
||||
"filter_from",
|
||||
"filter_subject",
|
||||
"filter_body",
|
||||
"filter_attachment_filename",
|
||||
"maximum_age",
|
||||
"attachment_type",
|
||||
),
|
||||
},
|
||||
),
|
||||
(
|
||||
_("Actions"),
|
||||
{
|
||||
"description": _(
|
||||
"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."
|
||||
),
|
||||
"fields": ("action", "action_parameter"),
|
||||
},
|
||||
),
|
||||
(
|
||||
_("Metadata"),
|
||||
{
|
||||
"description": _(
|
||||
"Assign metadata to documents consumed from this rule "
|
||||
"automatically. If you do not assign tags, types or "
|
||||
"correspondents here, paperless will still process all "
|
||||
"matching rules that you have defined."
|
||||
),
|
||||
"fields": (
|
||||
"assign_title_from",
|
||||
"assign_tag",
|
||||
"assign_document_type",
|
||||
"assign_correspondent_from",
|
||||
"assign_correspondent",
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
list_filter = ("account",)
|
||||
|
||||
list_display = ("order", "name", "account", "folder", "action")
|
||||
|
||||
list_editable = ("order", )
|
||||
list_editable = ("order",)
|
||||
|
||||
list_display_links = ("name", )
|
||||
list_display_links = ("name",)
|
||||
|
||||
sortable_by = []
|
||||
|
||||
|
Reference in New Issue
Block a user