]>
git.frykholm.com Git - tranquillity.git/blob - customerportal/admin.py
e2bdf1661dc71bcd76ce140c7bed6641dbb8e8fd
1 """Integrate with admin module."""
3 from django
.contrib
import admin
4 from django
.contrib
.auth
.admin
import UserAdmin
as DjangoUserAdmin
5 from django
.utils
.translation
import ugettext_lazy
as _
7 from .models
import User
11 class UserAdmin(DjangoUserAdmin
):
12 """Define admin model for custom User model with no email field."""
15 (None, {'fields': ('email', 'password')}),
16 (_('Personal info'), {'fields': ('first_name', 'last_name','fortnox_external_id')}),
17 (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
18 'groups', 'user_permissions')}),
19 (_('Important dates'), {'fields': ('last_login', 'date_joined')}),
24 'fields': ('email', 'password1', 'password2'),
27 list_display
= ('email', 'first_name', 'last_name', 'is_staff')
28 search_fields
= ('email', 'first_name', 'last_name')