admin user forms handle passwords correctly
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .forms import CustomUserChangeForm, CustomUserCreationForm
|
||||
|
||||
from . import models
|
||||
from .forms import CustomUserChangeForm, CustomUserCreationForm
|
||||
# Register your models here.
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
class UserAdmin(admin.ModelAdmin):
|
||||
model = models.CustomUser
|
||||
add_form = CustomUserCreationForm
|
||||
form = CustomUserChangeForm
|
||||
model = User
|
||||
|
||||
list_display = ('email', 'full_name', 'role', 'company', 'email_verified', 'is_active', 'is_staff', 'created', 'last_visit')
|
||||
list_filter = ('is_active', 'is_staff', 'email_verified')
|
||||
|
||||
Reference in New Issue
Block a user