Hide the password field (#103)

This commit is contained in:
Stéphane Brunner 2022-02-19 22:49:57 +01:00 committed by GitHub
parent 165b476635
commit 7113a18f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,25 @@
from django.contrib import admin
from django import forms
from paperless_mail.models import MailAccount, MailRule
from django.utils.translation import gettext_lazy as _
class MailAccountAdminForm(forms.ModelForm):
"""Metadata classes used by Django admin to display the form."""
class Meta:
"""Metadata class used by Django admin to display the form."""
model = MailAccount
widgets = {
'password': forms.PasswordInput(),
}
fields = '__all__'
class MailAccountAdmin(admin.ModelAdmin):
list_display = ("name", "imap_server", "username")
@ -19,6 +35,7 @@ class MailAccountAdmin(admin.ModelAdmin):
'fields': ['character_set']
})
]
form = MailAccountAdminForm
class MailRuleAdmin(admin.ModelAdmin):