diff --git a/openedx/core/djangoapps/notifications/admin.py b/openedx/core/djangoapps/notifications/admin.py index 621257ed9f..9fd69af219 100644 --- a/openedx/core/djangoapps/notifications/admin.py +++ b/openedx/core/djangoapps/notifications/admin.py @@ -12,6 +12,8 @@ class NotificationAdmin(admin.ModelAdmin): Admin for Notifications """ raw_id_fields = ('user',) + search_fields = ('course_id', 'user__username') + list_filter = ('app_name',) class CourseNotificationPreferenceAdmin(admin.ModelAdmin): @@ -20,7 +22,8 @@ class CourseNotificationPreferenceAdmin(admin.ModelAdmin): """ model = CourseNotificationPreference raw_id_fields = ('user',) - list_display = ['get_username', 'course_id', 'notification_preference_config'] + list_display = ('get_username', 'course_id', 'notification_preference_config') + search_fields = ('course_id', 'user__username') @admin.display(description='Username', ordering='user__username') def get_username(self, obj): diff --git a/openedx/core/djangoapps/notifications/models.py b/openedx/core/djangoapps/notifications/models.py index f9e1607d1e..d89a8a6ea3 100644 --- a/openedx/core/djangoapps/notifications/models.py +++ b/openedx/core/djangoapps/notifications/models.py @@ -127,7 +127,7 @@ class CourseNotificationPreference(TimeStampedModel): unique_together = ('user', 'course_id') def __str__(self): - return f'{self.user.username} - {self.course_id} - {self.notification_preference_config}' + return f'{self.user.username} - {self.course_id}' @staticmethod def get_updated_user_course_preferences(user, course_id):