clone from upstream lithium project
This commit is contained in:
parent
6f5167c24f
commit
f946e4933a
56 changed files with 754 additions and 503 deletions
30
accounts/admin.py
Normal file
30
accounts/admin.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
from django.contrib import admin
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.admin import UserAdmin
|
||||
|
||||
from .forms import CustomUserCreationForm, CustomUserChangeForm
|
||||
from .models import CustomUser
|
||||
|
||||
|
||||
class CustomUserAdmin(UserAdmin):
|
||||
add_form = CustomUserCreationForm
|
||||
form = CustomUserChangeForm
|
||||
model = CustomUser
|
||||
list_display = [
|
||||
"email",
|
||||
"username",
|
||||
]
|
||||
|
||||
# Explicitly define add_fieldsets to prevent unexpected fields
|
||||
add_fieldsets = (
|
||||
(
|
||||
None,
|
||||
{
|
||||
"classes": ("wide",),
|
||||
"fields": ("username", "email", "password1", "password2"),
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
admin.site.register(CustomUser, CustomUserAdmin)
|
||||
Loading…
Add table
Add a link
Reference in a new issue