aboutsummaryrefslogblamecommitdiffstats
path: root/ctrack/users/admin.py
blob: 7e930d8e835dca47e7c35b6a4c5d64b86fdf9559 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                               



                                                                      
                            
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model

from ctrack.users.forms import UserChangeForm, UserCreationForm

User = get_user_model()


@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):

    form = UserChangeForm
    add_form = UserCreationForm
    fieldsets = (
        ("User", {"fields": ("name", "stakeholder")}),
    ) + auth_admin.UserAdmin.fieldsets
    list_display = ["username", "name", "is_superuser", "stakeholder"]
    search_fields = ["name"]