Introduce notifications app and integrate emails
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.
This commit is contained in:
@@ -18,9 +18,10 @@ django_asgi_app = get_asgi_application()
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
from social.chat.routing import websocket_urlpatterns as social_ws
|
||||
from thirdparty.downloader.routing import websocket_urlpatterns as downloader_ws
|
||||
from notifications.routing import websocket_urlpatterns as notifications_ws
|
||||
from vontor_cz.middleware import JWTAuthMiddleware
|
||||
|
||||
websocket_urlpatterns = downloader_ws + social_ws
|
||||
websocket_urlpatterns = downloader_ws + social_ws + notifications_ws
|
||||
|
||||
application = ProtocolTypeRouter({
|
||||
"http": django_asgi_app,
|
||||
|
||||
@@ -348,6 +348,7 @@ MY_CREATED_APPS = [
|
||||
'social.posts',
|
||||
|
||||
'advertisement',
|
||||
'notifications',
|
||||
|
||||
'thirdparty.downloader',
|
||||
'thirdparty.stripe', # register Stripe app so its models are recognized
|
||||
|
||||
@@ -43,6 +43,7 @@ urlpatterns = [
|
||||
path('api/configuration/', include('configuration.urls')),
|
||||
path('api/advertisement/', include('advertisement.urls')),
|
||||
|
||||
path('api/notifications/', include('notifications.urls')),
|
||||
path('api/social/hubs/', include('social.hubs.urls')),
|
||||
path('api/social/posts/', include('social.posts.urls')),
|
||||
path('api/social/', include('social.chat.urls')),
|
||||
|
||||
Reference in New Issue
Block a user