From 39d0be9b987fd36bbe5707f422c322b07570d507 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Date: Sat, 22 Mar 2014 23:58:26 +0530 Subject: [PATCH] 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 --- .../{{cookiecutter.repo_name}}/users/admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/admin.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/admin.py index d91bb913..80e8e792 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/admin.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/admin.py @@ -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