Added all the notifications fields to the user admin panel
parent
dc090766da
commit
19177a4773
|
@ -29,6 +29,7 @@ class UserAdmin(DjangoUserAdmin):
|
|||
(None, {'fields': ('username', 'password')}),
|
||||
(_('Personal info'), {'fields': ('first_name', 'last_name', 'email', 'description', 'photo')}),
|
||||
(_('Extra info'), {'fields': ('color', 'default_language', 'default_timezone', 'token', 'colorize_tags')}),
|
||||
(_('Notifications info'), {'fields': ("notify_level", "notify_changes_by_me",)}),
|
||||
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
|
||||
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
|
||||
)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
from django import forms
|
||||
from django.contrib.auth.forms import UserCreationForm as DjangoUserCreationForm, UserChangeForm as DjangoUserChangeForm
|
||||
from greenmine.base.models import User
|
||||
|
||||
|
||||
class UserCreationForm(DjangoUserCreationForm):
|
||||
def clean_username(self):
|
||||
# Since User.username is unique, this check is redundant,
|
||||
|
@ -16,7 +18,11 @@ class UserCreationForm(DjangoUserCreationForm):
|
|||
model = User
|
||||
fields = ('username',)
|
||||
|
||||
|
||||
class UserChangeForm(DjangoUserChangeForm):
|
||||
notify_level = forms.ChoiceField(choices=User.NOTIFY_LEVEL_CHOICES)
|
||||
notify_changes_by_me = forms.BooleanField()
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
|
||||
|
|
Loading…
Reference in New Issue