remove domain field from Mailbox admin classes
This commit is contained in:
parent
cc7f5247ab
commit
cadcc3fa68
1 changed files with 7 additions and 8 deletions
|
@ -47,7 +47,7 @@ class MailboxCreationForm(forms.ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = Mailbox
|
||||
fields = ('username', 'domain')
|
||||
fields = ('username',)
|
||||
|
||||
def clean_password2(self):
|
||||
"""
|
||||
|
@ -83,8 +83,7 @@ class MailboxChangeForm(forms.ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = Mailbox
|
||||
fields = ('username', 'domain', 'password', 'home', 'uid', 'gid',
|
||||
'active')
|
||||
fields = ('username', 'password', 'home', 'uid', 'gid', 'active')
|
||||
|
||||
def clean_password(self):
|
||||
return self.initial['password']
|
||||
|
@ -98,21 +97,21 @@ class MailboxAdmin(admin.ModelAdmin):
|
|||
form = MailboxChangeForm
|
||||
add_form = MailboxCreationForm
|
||||
|
||||
list_display = ('username', 'domain', 'active')
|
||||
list_display = ('username', 'active')
|
||||
list_filter = ('active',)
|
||||
fieldsets = (
|
||||
(None, {
|
||||
'fields': ('username', 'domain', 'password', 'active')}),
|
||||
'fields': ('username', 'password', 'active')}),
|
||||
(_('System'), {
|
||||
'fields': ('home', 'uid', 'gid')}),
|
||||
)
|
||||
add_fieldsets = (
|
||||
(None, {
|
||||
'classes': ('wide',),
|
||||
'fields': ('username', 'domain', 'password1', 'password2')}),
|
||||
'fields': ('username', 'password1', 'password2')}),
|
||||
)
|
||||
search_fields = ('username', 'domain')
|
||||
ordering = ('username', 'domain')
|
||||
search_fields = ('username',)
|
||||
ordering = ('username',)
|
||||
filter_horizontal = ()
|
||||
|
||||
def get_fieldsets(self, request, obj=None):
|
||||
|
|
Loading…
Reference in a new issue