mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2024-11-17 04:09:25 +08:00
19 lines
465 B
Python
19 lines
465 B
Python
from django import forms
|
|
from django.contrib import admin
|
|
from django.contrib.auth.admin import UserAdmin
|
|
|
|
from .models import CustomUser
|
|
|
|
|
|
class CustomUserAdmin(UserAdmin):
|
|
model = CustomUser
|
|
list_display = (
|
|
"id",
|
|
"is_active",
|
|
"user_group",
|
|
) + UserAdmin.list_display
|
|
# Editable fields per instance
|
|
fieldsets = UserAdmin.fieldsets + ((None, {"fields": ("avatar",)}),)
|
|
|
|
|
|
admin.site.register(CustomUser, CustomUserAdmin)
|