22 lines
733 B
Python
22 lines
733 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
from django.contrib import admin
|
||
|
from django.contrib.auth.admin import UserAdmin
|
||
|
from django.utils.translation import ugettext_lazy as _
|
||
|
|
||
|
from .models import CustomUser
|
||
|
|
||
|
|
||
|
class CustomUserAdmin(UserAdmin):
|
||
|
model = CustomUser
|
||
|
|
||
|
fieldsets = (
|
||
|
(None, {'fields': ('username', 'password')}),
|
||
|
(_('Personal info'), {'fields': ('first_name', 'last_name', 'email')}),
|
||
|
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
|
||
|
'groups', 'user_permissions')}),
|
||
|
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
|
||
|
(_('Sites'), {'fields': ('sites',)})
|
||
|
)
|
||
|
|
||
|
admin.site.register(CustomUser, CustomUserAdmin)
|