From b6a3ae56c373297d0aa62f46b596d020225a21a3 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Tue, 27 Jun 2023 00:06:20 +0800 Subject: [PATCH] Added relevant fields to Django admin panel --- stude/accounts/admin.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/stude/accounts/admin.py b/stude/accounts/admin.py index 5ef0f20..81a8c48 100644 --- a/stude/accounts/admin.py +++ b/stude/accounts/admin.py @@ -2,4 +2,14 @@ from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import CustomUser -admin.site.register(CustomUser, UserAdmin) + +class CustomUserAdmin(UserAdmin): + model = CustomUser + + fieldsets = UserAdmin.fieldsets + ( + (None, {'fields': ('student_id_number', + 'year_level', 'semester', 'avatar', 'is_banned')}), + ) + + +admin.site.register(CustomUser, CustomUserAdmin)