Files
edx-platform/openedx/core/djangoapps/notifications/admin.py
Ahtisham Shahid b477a20ad2 Added notifications for discussions events (#32432)
* feat: added notifications for discussions app

* feat: added unit tests for handler

* feat: updated openedx-events package

* fix: updated notification creation logic and tests

* refactor: updated openedx-event version and event name

* refactor: moved logic to separate methods
2023-07-06 13:33:20 +05:00

28 lines
715 B
Python

"""
Django Admin for Notifications
"""
from django.contrib import admin
from .models import CourseNotificationPreference, Notification
class NotificationAdmin(admin.ModelAdmin):
pass
class CourseNotificationPreferenceAdmin(admin.ModelAdmin):
"""
Admin for Course Notification Preferences
"""
model = CourseNotificationPreference
list_display = ['get_username', 'course_id', 'notification_preference_config']
@admin.display(description='Username', ordering='user__username')
def get_username(self, obj):
return obj.user.username
admin.site.register(Notification, NotificationAdmin)
admin.site.register(CourseNotificationPreference, CourseNotificationPreferenceAdmin)