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:
|
class Meta:
|
||||||
model = Mailbox
|
model = Mailbox
|
||||||
fields = ('username', 'domain')
|
fields = ('username',)
|
||||||
|
|
||||||
def clean_password2(self):
|
def clean_password2(self):
|
||||||
"""
|
"""
|
||||||
|
@ -83,8 +83,7 @@ class MailboxChangeForm(forms.ModelForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Mailbox
|
model = Mailbox
|
||||||
fields = ('username', 'domain', 'password', 'home', 'uid', 'gid',
|
fields = ('username', 'password', 'home', 'uid', 'gid', 'active')
|
||||||
'active')
|
|
||||||
|
|
||||||
def clean_password(self):
|
def clean_password(self):
|
||||||
return self.initial['password']
|
return self.initial['password']
|
||||||
|
@ -98,21 +97,21 @@ class MailboxAdmin(admin.ModelAdmin):
|
||||||
form = MailboxChangeForm
|
form = MailboxChangeForm
|
||||||
add_form = MailboxCreationForm
|
add_form = MailboxCreationForm
|
||||||
|
|
||||||
list_display = ('username', 'domain', 'active')
|
list_display = ('username', 'active')
|
||||||
list_filter = ('active',)
|
list_filter = ('active',)
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(None, {
|
(None, {
|
||||||
'fields': ('username', 'domain', 'password', 'active')}),
|
'fields': ('username', 'password', 'active')}),
|
||||||
(_('System'), {
|
(_('System'), {
|
||||||
'fields': ('home', 'uid', 'gid')}),
|
'fields': ('home', 'uid', 'gid')}),
|
||||||
)
|
)
|
||||||
add_fieldsets = (
|
add_fieldsets = (
|
||||||
(None, {
|
(None, {
|
||||||
'classes': ('wide',),
|
'classes': ('wide',),
|
||||||
'fields': ('username', 'domain', 'password1', 'password2')}),
|
'fields': ('username', 'password1', 'password2')}),
|
||||||
)
|
)
|
||||||
search_fields = ('username', 'domain')
|
search_fields = ('username',)
|
||||||
ordering = ('username', 'domain')
|
ordering = ('username',)
|
||||||
filter_horizontal = ()
|
filter_horizontal = ()
|
||||||
|
|
||||||
def get_fieldsets(self, request, obj=None):
|
def get_fieldsets(self, request, obj=None):
|
||||||
|
|
Loading…
Reference in a new issue