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(),