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
This commit is contained in:
parent
fb5f8d7b14
commit
5cd4c3e559
|
@ -62,11 +62,11 @@ class UserAdmin(admin.ModelAdmin):
|
||||||
Use special form during user creation
|
Use special form during user creation
|
||||||
"""
|
"""
|
||||||
defaults = {}
|
defaults = {}
|
||||||
if not obj:
|
if obj is None:
|
||||||
defaults = {
|
defaults.update({
|
||||||
'form': UserCreationForm,
|
'form': self.add_form,
|
||||||
'fields': ['username'],
|
'fields': admin.util.flatten_fieldsets(self.add_fieldsets),
|
||||||
}
|
})
|
||||||
defaults.update(kwargs)
|
defaults.update(kwargs)
|
||||||
return super(UserAdmin, self).get_form(request, obj, **defaults)
|
return super(UserAdmin, self).get_form(request, obj, **defaults)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue