From 2206f7c1ddb2438b4ee8fe1bcba1bcf416e84f6e Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 24 Jun 2022 14:34:47 +0100 Subject: [PATCH] Update admin.py Use `autocomplete_fields` to keep the select user field manageable. --- rest_framework/authtoken/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rest_framework/authtoken/admin.py b/rest_framework/authtoken/admin.py index b359e4cfe8..e41eb00023 100644 --- a/rest_framework/authtoken/admin.py +++ b/rest_framework/authtoken/admin.py @@ -25,6 +25,7 @@ class TokenAdmin(admin.ModelAdmin): fields = ('user',) ordering = ('-created',) actions = None # Actions not compatible with mapped IDs. + autocomplete_fields = ("user",) def get_changelist(self, request, **kwargs): return TokenChangeList