- Notification model with idempotency_key dedup (unique per event+object+recipient) - NotificationDelivery audit model (pending/sent/failed/delivered per channel) - notify() service: creates notification idempotently, enqueues per-channel tasks - deliver_notification_task Celery task: sends email via send_mail, marks in-app as sent without email; marks FAILED with error_detail on exception (autoretry x3) - Event trigger helpers: notify_course_assigned, notify_attempt_limit_reached, notify_certificate_issued, notify_certificate_expiring (daily-reminder safe) - send_course_due_reminders_task: periodic Celery Beat stub for due-date alerts - REST API: list notifications (with ?unread=true filter), mark-read, mark-all-read - Admin registrations with inline delivery audit view - Initial migration (Notification + NotificationDelivery tables) - Pytest test suite: idempotency, delivery dispatch, view auth/filtering Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
406 B
Python
12 lines
406 B
Python
from django.urls import path
|
|
|
|
from .views import NotificationListView, NotificationMarkAllReadView, NotificationMarkReadView
|
|
|
|
app_name = "notifications"
|
|
|
|
urlpatterns = [
|
|
path("", NotificationListView.as_view(), name="list"),
|
|
path("read-all/", NotificationMarkAllReadView.as_view(), name="read-all"),
|
|
path("<uuid:notification_id>/read/", NotificationMarkReadView.as_view(), name="mark-read"),
|
|
]
|