My Django Admin is returning the error: “Please correct the errors below.” without highlighting any errors in the admin page, even the HTTP response returns with HTTP 200, but data are not updated.
My Admin Code is as so
class UserAccessInLine(admin.StackedInline):
model = UserAccess
can_delete = False
verbose_name = 'User Access'
fields = (('unique_user_id', 'access_level', 'access_status'), 'profile_pic')
readonly_fields = ('unique_user_id',)
class UserAdmin(BaseUserAdmin):
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('username', 'password1', 'password2',
'first_name', 'last_name'),
}),
)
inlines = [UserAccessInLine]
list_display = ['username', 'first_name', 'last_name', 'get_access_status', 'get_unique_user_id']
ordering = ['username']
@admin.display(description='Access Role', ordering='username')
def get_access_status(self, obj):
return obj.useraccess.access_status
@admin.display(description='User ID', ordering='username')
def get_unique_user_id(self, obj):
return obj.useraccess.unique_user_id
admin.site.unregister(User)
admin.site.register(User, UserAdmin)