from django.contrib import admin
from django.contrib.admin import register
from . import models

@register(models.FalmerUser)
class FalmerUserModelAdmin(admin.ModelAdmin):
    list_display = ('name_or_email', 'identifier', 'authority')
    list_filter = ('authority', )
    search_fields = ('name', 'identifier')


from django.contrib import admin
from django.contrib.auth.admin import UserAdmin

# @register(models.FalmerUser)
# class FalmerUserModelAdmin(admin.ModelAdmin):
#     list_display = ('name_or_email', 'identifier', 'authority')
#     list_filter = ('authority', )
#     search_fields = ('name', 'identifier')
from falmer.auth import models


class FalmerUserAdmin(UserAdmin):
    ordering = ('name', 'identifier')
    list_display = ('name_or_email', 'identifier', 'authority')

    fieldsets = (
        (None, {'fields': ('identifier', 'authority')}),
        ('Personal info', {'fields': ('name',)}),
        ('Permissions', {            'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions'),
                                     })
    )


admin.site.register(models.FalmerUser, FalmerUserAdmin)

Replace FalmerUserAdmin with extention of base
Replace FalmerUserAdmin with extention of base

  from django.contrib import admin
- from django.contrib.admin import register
+ from django.contrib.auth.admin import UserAdmin
- from . import models
  
- @register(models.FalmerUser)
+ # @register(models.FalmerUser)
- class FalmerUserModelAdmin(admin.ModelAdmin):
+ # class FalmerUserModelAdmin(admin.ModelAdmin):
-     list_display = ('name_or_email', 'identifier', 'authority')
+ #     list_display = ('name_or_email', 'identifier', 'authority')
-     list_filter = ('authority', )
+ #     list_filter = ('authority', )
-     search_fields = ('name', 'identifier')
+ #     search_fields = ('name', 'identifier')
+ from falmer.auth import models
  
  
+ class FalmerUserAdmin(UserAdmin):
+     ordering = ('name', 'identifier')
+     list_display = ('name_or_email', 'identifier', 'authority')
+ 
+     fieldsets = (
+         (None, {'fields': ('identifier', 'authority')}),
+         ('Personal info', {'fields': ('name',)}),
+         ('Permissions', {            'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions'),
+                                      })
+     )
+ 
+ 
+ admin.site.register(models.FalmerUser, FalmerUserAdmin)
+ 
Replace FalmerUserAdmin with extention of base
## Code Before:
from django.contrib import admin
from django.contrib.admin import register
from . import models

@register(models.FalmerUser)
class FalmerUserModelAdmin(admin.ModelAdmin):
    list_display = ('name_or_email', 'identifier', 'authority')
    list_filter = ('authority', )
    search_fields = ('name', 'identifier')


## Instruction:
Replace FalmerUserAdmin with extention of base
## Code After:
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin

# @register(models.FalmerUser)
# class FalmerUserModelAdmin(admin.ModelAdmin):
#     list_display = ('name_or_email', 'identifier', 'authority')
#     list_filter = ('authority', )
#     search_fields = ('name', 'identifier')
from falmer.auth import models


class FalmerUserAdmin(UserAdmin):
    ordering = ('name', 'identifier')
    list_display = ('name_or_email', 'identifier', 'authority')

    fieldsets = (
        (None, {'fields': ('identifier', 'authority')}),
        ('Personal info', {'fields': ('name',)}),
        ('Permissions', {            'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions'),
                                     })
    )


admin.site.register(models.FalmerUser, FalmerUserAdmin)
