Add api token field to UserAdmin (#241)

This commit is contained in:
havk 2022-11-07 17:52:13 +01:00 committed by GitHub
parent 2de0b9b9e1
commit b397d1fd6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,15 @@
from django.contrib import admin from django.contrib import admin
from django.contrib.auth.admin import UserAdmin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import Service, User from .models import Service, User
class UserAdmin(BaseUserAdmin):
fieldsets = BaseUserAdmin.fieldsets + (
("Extra fields", {"fields": ("api_token",)}),
)
admin.site.register(User, UserAdmin) admin.site.register(User, UserAdmin)