From fdaddc001b32ac55ce119647aed89731e7056cfd Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 17 Nov 2024 11:49:06 +0100 Subject: [PATCH] fix: Unregisters Group from admin panel Removes Group model from the Django admin interface to simplify admin views and focus on custom registration logic. This cleanup aids in preventing unnecessary admin clutter, ensuring the admin interface aligns with project-specific needs. Improves admin interface customization and usability. --- src/synapse_registration/registration/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/synapse_registration/registration/admin.py b/src/synapse_registration/registration/admin.py index 004361e..d3083f0 100644 --- a/src/synapse_registration/registration/admin.py +++ b/src/synapse_registration/registration/admin.py @@ -1,9 +1,12 @@ from django.contrib import admin +from django.contrib.auth.models import Group from .models import UserRegistration admin.site.site_header = "Synapse Registration Administration" +admin.site.unregister(Group) + @admin.register(UserRegistration) class UserRegistrationAdmin(admin.ModelAdmin): @@ -16,7 +19,7 @@ class UserRegistrationAdmin(admin.ModelAdmin): for registration in queryset: registration.status = UserRegistration.STATUS_APPROVED registration.save() - + self.message_user(request, f"{queryset.count()} registrations approved.") def deny_registrations(self, request, queryset):