Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Jannis Leidel authored January 19, 2010

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. 10  django/contrib/auth/admin.py
10  django/contrib/auth/admin.py
@@ -62,11 +62,11 @@ def get_form(self, request, obj=None, **kwargs):
62 62
         Use special form during user creation
63 63
         """
64 64
         defaults = {}
65  
-        if not obj:
66  
-            defaults = {
67  
-                'form': UserCreationForm,
68  
-                'fields': ['username'],
69  
-            }
  65
+        if obj is None:
  66
+            defaults.update({
  67
+                'form': self.add_form,
  68
+                'fields': admin.util.flatten_fieldsets(self.add_fieldsets),
  69
+            })
70 70
         defaults.update(kwargs)
71 71
         return super(UserAdmin, self).get_form(request, obj, **defaults)
72 72
 

0 notes on commit 5cd4c3e

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