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.
This commit is contained in:
parent
0817c9ceb0
commit
fdaddc001b
1 changed files with 4 additions and 1 deletions
|
@ -1,9 +1,12 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django.contrib.auth.models import Group
|
||||||
|
|
||||||
from .models import UserRegistration
|
from .models import UserRegistration
|
||||||
|
|
||||||
admin.site.site_header = "Synapse Registration Administration"
|
admin.site.site_header = "Synapse Registration Administration"
|
||||||
|
|
||||||
|
admin.site.unregister(Group)
|
||||||
|
|
||||||
|
|
||||||
@admin.register(UserRegistration)
|
@admin.register(UserRegistration)
|
||||||
class UserRegistrationAdmin(admin.ModelAdmin):
|
class UserRegistrationAdmin(admin.ModelAdmin):
|
||||||
|
@ -16,7 +19,7 @@ class UserRegistrationAdmin(admin.ModelAdmin):
|
||||||
for registration in queryset:
|
for registration in queryset:
|
||||||
registration.status = UserRegistration.STATUS_APPROVED
|
registration.status = UserRegistration.STATUS_APPROVED
|
||||||
registration.save()
|
registration.save()
|
||||||
|
|
||||||
self.message_user(request, f"{queryset.count()} registrations approved.")
|
self.message_user(request, f"{queryset.count()} registrations approved.")
|
||||||
|
|
||||||
def deny_registrations(self, request, queryset):
|
def deny_registrations(self, request, queryset):
|
||||||
|
|
Loading…
Reference in a new issue