old_contents: from django import forms
  from django.contrib import admin
  from django.contrib.auth.admin import UserAdmin
  from django.contrib.auth.models import User, Group
  
  
  class UserForm(forms.ModelForm):
  
      class Meta:
          model = User
          fields = ('username', 'email', 'first_name', 'last_name', 'is_active',
                    'is_staff', 'is_superuser')
  
  
  class CustomUserAdmin(UserAdmin):
      fieldsets = None
      form = UserForm
      search_fields = ('=username',)
  
  
  admin.site.unregister(User)
  admin.site.unregister(Group)
  admin.site.register(User, CustomUserAdmin)
  
new_contents: from django import forms
  from django.contrib import admin
  from django.contrib.auth.admin import UserAdmin
  from django.contrib.auth.models import User, Group
  
  
  class UserForm(forms.ModelForm):
  
      class Meta:
          model = User
          fields = ('username', 'email', 'first_name', 'last_name', 'is_active',
                    'is_staff', 'is_superuser')
  
  
  class CustomUserAdmin(UserAdmin):
      fieldsets = None
      form = UserForm
      search_fields = ('=username',)
      list_filter = ('is_staff', 'is_superuser', 'is_active')
  
  admin.site.unregister(User)
  admin.site.unregister(Group)
  admin.site.register(User, CustomUserAdmin)
  
subject: Fix broken query in User admin #46