From b397d1fd6adc567b694ba65177b62d16d3cb3f5f Mon Sep 17 00:00:00 2001 From: havk Date: Mon, 7 Nov 2022 17:52:13 +0100 Subject: [PATCH] Add api token field to UserAdmin (#241) --- shynet/core/admin.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shynet/core/admin.py b/shynet/core/admin.py index 118b68c..bd8e306 100644 --- a/shynet/core/admin.py +++ b/shynet/core/admin.py @@ -1,8 +1,15 @@ 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 + +class UserAdmin(BaseUserAdmin): + fieldsets = BaseUserAdmin.fieldsets + ( + ("Extra fields", {"fields": ("api_token",)}), + ) + + admin.site.register(User, UserAdmin)