From 36d11db9cf977bfde58859137ef86002da60585d Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 4 May 2024 00:05:06 +0200 Subject: [PATCH] stash --- core/notifications/dispatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/notifications/dispatch.py b/core/notifications/dispatch.py index 37494a0..389535e 100644 --- a/core/notifications/dispatch.py +++ b/core/notifications/dispatch.py @@ -27,7 +27,6 @@ async def email_notify(message, email): await send_smtp(mail) - class NotificationDispatcher: channel_layer = None room_group_name = "general" @@ -65,7 +64,8 @@ class NotificationDispatcher: print("Error: Invalid message format") async def dispatch(self, ticket, event_id, new): - message = render_notification_new_ticket(ticket) if new else render_notification_reply_ticket(ticket) + message = database_sync_to_async(render_notification_new_ticket)(ticket) if new else database_sync_to_async( + render_notification_reply_ticket)(ticket) print("Dispatching message:", message, "with event_id:", event_id) targets = await self.get_notification_targets() await telegram_notify(message, TELEGRAM_GROUP_CHAT_ID)