| """ |
| Admin configuration for the notifications app. |
| """ |
| from django.contrib import admin |
|
|
| from apps.notifications.models import NotificationPreference, NotificationTemplate |
|
|
|
|
| @admin.register(NotificationPreference) |
| class NotificationPreferenceAdmin(admin.ModelAdmin): |
| """Admin for notification preferences.""" |
|
|
| list_display = ("user", "channel", "enabled", "created_at") |
| list_filter = ("channel", "enabled") |
| search_fields = ("user__email",) |
| raw_id_fields = ("user",) |
|
|
|
|
| @admin.register(NotificationTemplate) |
| class NotificationTemplateAdmin(admin.ModelAdmin): |
| """Admin for notification templates.""" |
|
|
| list_display = ("slug", "name", "channel", "is_active", "created_at") |
| list_filter = ("channel", "is_active") |
| search_fields = ("slug", "name") |
| prepopulated_fields = {"slug": ("name",)} |
|
|