Update admin.py

Use `autocomplete_fields` to keep the select user field manageable.
This commit is contained in:
Tom Christie 2022-06-24 14:34:47 +01:00 committed by GitHub
parent 9f07d9edeb
commit 2206f7c1dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ class TokenAdmin(admin.ModelAdmin):
fields = ('user',) fields = ('user',)
ordering = ('-created',) ordering = ('-created',)
actions = None # Actions not compatible with mapped IDs. actions = None # Actions not compatible with mapped IDs.
autocomplete_fields = ("user",)
def get_changelist(self, request, **kwargs): def get_changelist(self, request, **kwargs):
return TokenChangeList return TokenChangeList