Add groups and permissions to user admin
@@ -34,17 +34,29 @@ class PyConUserAdmin(UserAdmin):
# The fields to be used in displaying the User model.
# These override the definitions on the base UserAdmin
# that reference the removed 'username' field
- fieldsets = ((None, {
+ fieldsets = (
+ (None, {
'fields': ('email', 'password')
- }), (_('Permissions'), {
- 'fields': ('is_active', 'is_staff', 'is_superuser')
- }), (_('Important dates'), {
+ }),
+ (_('Permissions'), {
+ 'fields': (
+ 'is_active',
+ 'is_staff',
+ 'is_superuser',
+ 'groups',
+ 'user_permissions',
+ )
+ }),
+ (_('Important dates'), {
'fields': ('last_login', 'date_joined')
- }), )
+ }),
+ )
+
add_fieldsets = ((None, {
'classes': ('wide', ),
'fields': ('email', 'password1', 'password2')
}), )
+
form = PyConUserChangeForm
add_form = PyConUserCreationForm
readonly_fields = ('date_joined', )
