From 8978bc26e1db49623345ea10adbcaaae056f34f6 Mon Sep 17 00:00:00 2001 From: Matthew Piatetsky Date: Thu, 27 May 2021 11:28:25 -0400 Subject: [PATCH] feat: add admin for the User Celebration Model --- common/djangoapps/student/admin.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/djangoapps/student/admin.py b/common/djangoapps/student/admin.py index 88bcaf4d64..a5ead71d04 100644 --- a/common/djangoapps/student/admin.py +++ b/common/djangoapps/student/admin.py @@ -41,6 +41,7 @@ from common.djangoapps.student.models import ( Registration, RegistrationCookieConfiguration, UserAttribute, + UserCelebration, UserProfile, UserTestGroup ) @@ -538,6 +539,19 @@ class CourseEnrollmentCelebrationAdmin(DisableEnrollmentAdminMixin, admin.ModelA user.short_description = 'User' +@admin.register(UserCelebration) +class UserCelebrationAdmin(admin.ModelAdmin): + """Admin interface for the UserCelebration model.""" + readonly_fields = ('user', ) + + class Meta: + model = UserCelebration + + # Disables the index view to avoid possible performance issues when + # a large number of user celebrations are present. + def has_module_permission(self, request): + return False + admin.site.register(UserTestGroup) admin.site.register(Registration) admin.site.register(PendingNameChange)