Add a new notifications app (models, serializers, views, admin, tasks, consumers, routing, urls, tests) with Notification.notify for in-app websocket pushes and optional email delivery. Centralize email sending in notifications.tasks.send_email_with_context and re-export it from account.tasks for compatibility. Update account and commerce and advertisement tasks to use Notification.notify/_notify_order and the new email helper; adjust order/notification tasks to consolidate logic. Wire notifications into ASGI routing, settings and URL conf. Misc: handle OSError when importing weasyprint, add tmp/ to .gitignore, add local .claude PowerShell checks, add social.blog skeleton, and remove legacy ews-component test files.
12 lines
552 B
Python
12 lines
552 B
Python
from django.contrib import admin
|
|
from .models import Notification
|
|
|
|
|
|
@admin.register(Notification)
|
|
class NotificationAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "title", "notification_type", "user", "is_read", "bulk", "send_email", "created_at")
|
|
list_filter = ("notification_type", "is_read", "bulk", "send_email", "created_at")
|
|
search_fields = ("title", "text", "user__email", "user__username")
|
|
ordering = ("-created_at",)
|
|
readonly_fields = ("created_at", "read_at", "email_subject", "email_template_path", "send_email", "bulk")
|