This class raises a systems check django error. The specific error it raises is as pasted below. I have looked through previous posts that suggest it was an error that resulted from migrating to django 2.1 and adding a comma at the end of the fields tuple fixed it. This does not work for me. Any help would be greatly appreciated.
SystemCheckError: System check identified some issues:
ERRORS:
<class 'app.admin.user.UserAdmin'>: (admin.E012) There are duplicate field(s) in 'fieldsets[1][1]'.
<class 'app.admin.user.UserAdmin'>: (admin.E012) There are duplicate field(s) in 'fieldsets[2][1]'.
<class 'app.admin.user.UserAdmin'>: (admin.E012) There are duplicate field(s) in 'fieldsets[3][1]'.
@register(User)
class UserAdmin(ModelAdmin):
fieldsets = (
(None, {'fields': ('email', 'password',)}),
('Personal info', {
'fields': ('first_name', 'last_name', 'email',)}),
('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',),
}),
)
list_display = ('email', 'first_name', 'last_name', 'username', 'is_staff')
list_filter = ('is_staff', 'is_superuser', 'is_active', 'groups',)
search_fields = ('email', 'first_name', 'last_name',)
ordering = ('email',)
filter_horizontal = ('groups', 'user_permissions',)