From bc0d06e00dc5b0759df5de5089ffb89c9ef039d9 Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 4 May 2024 00:59:11 +0200 Subject: [PATCH] stash --- core/notifications/templates.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/notifications/templates.py b/core/notifications/templates.py index 6703998..1dd7aea 100644 --- a/core/notifications/templates.py +++ b/core/notifications/templates.py @@ -1,4 +1,5 @@ import jinja2 +from channels.db import database_sync_to_async from core.settings import PRIMARY_HOST from notifications.models import MessageTemplate @@ -36,18 +37,21 @@ def render_template(template, **kwargs): return None +@database_sync_to_async def render_auto_reply(ticket): eventslug = ticket.event.slug if ticket.event else "37C3" # TODO 37C3 should not be hardcoded return render_template('auto_reply', ticket_name=ticket.name, ticket_uuid=ticket.short_uuid(), ticket_id=ticket.id, event_slug=eventslug, ticket_url=ticket_url(ticket)) +@database_sync_to_async def render_notification_new_ticket(ticket): eventslug = ticket.event.slug if ticket.event else "37C3" # TODO 37C3 should not be hardcoded return render_template('new_issue_notification', ticket_name=ticket.name, ticket_uuid=ticket.short_uuid(), ticket_id=ticket.id, event_slug=eventslug, ticket_url=ticket_url(ticket)) +@database_sync_to_async def render_notification_reply_ticket(ticket): eventslug = ticket.event.slug if ticket.event else "37C3" # TODO 37C3 should not be hardcoded return render_template('reply_issue_notification', ticket_name=ticket.name, ticket_uuid=ticket.short_uuid(),