Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #12644 - Allow overriding the admin user creation form based on…

… r12216. Thanks, minmax.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12265 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5cd4c3e5595128bc1a3f28f2e30bab2e4dd3b1b7 1 parent fb5f8d7
@jezdez jezdez authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 django/contrib/auth/admin.py
View
10 django/contrib/auth/admin.py
@@ -62,11 +62,11 @@ def get_form(self, request, obj=None, **kwargs):
Use special form during user creation
"""
defaults = {}
- if not obj:
- defaults = {
- 'form': UserCreationForm,
- 'fields': ['username'],
- }
+ if obj is None:
+ defaults.update({
+ 'form': self.add_form,
+ 'fields': admin.util.flatten_fieldsets(self.add_fieldsets),
+ })
defaults.update(kwargs)
return super(UserAdmin, self).get_form(request, obj, **defaults)

0 comments on commit 5cd4c3e

Please sign in to comment.
Something went wrong with that request. Please try again.