diff --git a/django/contrib/auth/admin.py b/django/contrib/auth/admin.py index 81a963d015..b444fa5bac 100644 --- a/django/contrib/auth/admin.py +++ b/django/contrib/auth/admin.py @@ -62,11 +62,11 @@ class UserAdmin(admin.ModelAdmin): 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)