You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
# -*- coding: utf-8 -*-
|
|
from django.contrib import admin
|
|
from django.contrib.auth.models import Group
|
|
from django.contrib.auth.admin import UserAdmin
|
|
|
|
from models import User
|
|
from forms import UserCreationForm, UserChangeForm
|
|
|
|
|
|
|
|
class UserAdmin(UserAdmin):
|
|
|
|
form = UserChangeForm
|
|
add_form = UserCreationForm
|
|
|
|
list_display = ('email', 'first_name', 'last_name', 'is_admin',)
|
|
list_filter = ('is_admin',)
|
|
|
|
fieldsets = (
|
|
(None, {'fields': ('email', 'first_name', 'last_name', 'password')}),
|
|
(None, {'fields': ('url', 'country', 'city', 'position',
|
|
'about', 'phone', 'avatar', 'web_page',
|
|
'social', 'title', 'descriptions', 'keywords',
|
|
'is_admin', 'is_active')}),
|
|
|
|
)
|
|
add_fieldsets = (
|
|
(None, {'classes': ('wide',), 'fields': ('email','first_name', 'last_name', 'password1', 'password2')}),
|
|
)
|
|
ordering = ('email',)
|
|
filter_horizontal = ()
|
|
|
|
admin.site.register(User, UserAdmin)
|
|
admin.site.unregister(Group) |