mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 03:24:01 +03:00
fix(app/user): use proper UserAdmin auth form
* use `django.contrib.auth.admin.UserAdmin`. * using `admin.ModelAdmin` do not provide forms to properly handle `passwords` [1]: https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms
This commit is contained in:
parent
1ad866770a
commit
39d0be9b98
|
@ -1,11 +1,12 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
||||
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
|
||||
|
||||
from .models import User
|
||||
|
||||
|
||||
class UserAdmin(admin.ModelAdmin):
|
||||
class UserAdmin(AuthUserAdmin):
|
||||
create_form_class = UserCreationForm
|
||||
update_form_class = UserChangeForm
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user