This commit is contained in:
j3d1 2024-04-26 16:07:36 +02:00
parent 4603aa33ed
commit 502d7e687e
2 changed files with 9 additions and 3 deletions

View file

@ -29,7 +29,9 @@ SECRET_KEY = 'django-insecure-tm*$w_14iqbiy-!7(8#ba7j+_@(7@rf2&a^!=shs&$03b%2*rv
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
ALLOWED_HOSTS = [os.getenv('HTTP_HOST', 'localhost')] PRIMARY_HOST = os.getenv('HTTP_HOST', 'localhost')
ALLOWED_HOSTS = [PRIMARY_HOST]
MAIL_DOMAIN = os.getenv('MAIL_DOMAIN', 'localhost') MAIL_DOMAIN = os.getenv('MAIL_DOMAIN', 'localhost')

View file

@ -4,6 +4,8 @@ import aiosmtplib
from channels.layers import get_channel_layer from channels.layers import get_channel_layer
from channels.db import database_sync_to_async from channels.db import database_sync_to_async
from django.core.files.base import ContentFile from django.core.files.base import ContentFile
from core.settings import PRIMARY_HOST
from mail.models import Email, EventAddress, EmailAttachment from mail.models import Email, EventAddress, EmailAttachment
from notify_sessions.models import SystemEvent from notify_sessions.models import SystemEvent
from tickets.models import IssueThread from tickets.models import IssueThread
@ -255,9 +257,11 @@ Your c3lf (Cloakroom + Lost&Found) Team'''.format(active_issue_thread.short_uuid
else: else:
notify_subject = active_issue_thread.name notify_subject = active_issue_thread.name
if new: if new:
notification = f"New issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] created by {sender}" notification = f"""New issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] created
see https://{PRIMARY_HOST}/{target_event.slug}/ticket/{active_issue_thread.short_uuid.id}/"""
else: else:
notification = f"Reply to issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}] by {sender}" notification = f"""Reply to issue \"{active_issue_thread.name}\" [{active_issue_thread.short_uuid()}]
see https://{PRIMARY_HOST}/{target_event.slug}/ticket/{active_issue_thread.short_uuid.id}/"""
return email, new, reply, notification return email, new, reply, notification