Generateurv2/backend/api/users/admin.py
Kilton937342 035af2a3b7 modifs
2022-06-11 23:39:03 +02:00

16 lines
452 B
Python

# users/admin.py
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .forms import CustomUserChangeForm, CustomUserCreationForm
from .models import CustomUser
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
form = CustomUserChangeForm
model = CustomUser
list_display = ['username']
admin.site.register(CustomUser, CustomUserAdmin)