Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit f09817a

Browse files
committed
Hide the password field
1 parent 7bc8325 commit f09817a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/paperless_mail/admin.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
from django.contrib import admin
2+
from django import forms
23
from paperless_mail.models import MailAccount, MailRule
34

45
from django.utils.translation import gettext_lazy as _
56

67

8+
class MailAccountAdminForm(forms.ModelForm):
9+
10+
"""Metadata classes uset in Django admin to display the form."""
11+
12+
class Meta:
13+
14+
"""Metadata class uset in Django admin to display the form."""
15+
16+
model = MailAccount
17+
widgets = {
18+
'password': forms.PasswordInput(),
19+
}
20+
fields = '__all__'
21+
22+
723
class MailAccountAdmin(admin.ModelAdmin):
824

925
list_display = ("name", "imap_server", "username")
@@ -19,6 +35,7 @@ class MailAccountAdmin(admin.ModelAdmin):
1935
'fields': ['character_set']
2036
})
2137
]
38+
form = MailAccountAdminForm
2239

2340

2441
class MailRuleAdmin(admin.ModelAdmin):

0 commit comments

Comments
 (0)