Skip to content

Commit

Permalink
chore(admin): better token search in admin (#4497)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell authored Aug 14, 2024
1 parent a395a47 commit f9cc1b0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/custom_auth/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.contrib import admin
from rest_framework.authtoken.admin import TokenAdmin
from rest_framework.authtoken.models import TokenProxy


class CustomTokenAdmin(TokenAdmin):
search_fields = ("user__email",)


admin.site.unregister(TokenProxy)
admin.site.register(TokenProxy, CustomTokenAdmin)

0 comments on commit f9cc1b0

Please sign in to comment.