mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-01-19 01:23:02 +08:00
17 lines
486 B
Python
17 lines
486 B
Python
from django.contrib import admin
|
|
from django.contrib.auth.admin import UserAdmin
|
|
|
|
from .models import CustomUser
|
|
|
|
|
|
class CustomUserAdmin(UserAdmin):
|
|
model = CustomUser
|
|
list_display = ("id", "full_name", "role", "is_active")
|
|
readonly_fields = ("date_joined",)
|
|
|
|
# Add this line to include the role field in the admin form
|
|
fieldsets = UserAdmin.fieldsets + \
|
|
((None, {"fields": ("role", "sex", "birthday")}),)
|
|
|
|
|
|
admin.site.register(CustomUser, CustomUserAdmin)
|