Use site domain

parent 63cc402a
......@@ -4,6 +4,7 @@ import datetime
from django import forms
from django.contrib import admin, messages
from django.conf import settings
from django.db.models import Q
from django.http import HttpResponse
from django.utils import timezone
......@@ -58,7 +59,7 @@ class CommitteeAdmin(TranslatedModelAdmin):
if instance.contact_email:
return instance.contact_email
elif instance.contact_mailinglist:
return instance.contact_mailinglist.name + '@thalia.nu'
return f'{instance.contact_mailinglist.name}@{settings.SITE_DOMAIN}'
return None
......@@ -80,7 +81,8 @@ class SocietyAdmin(TranslatedModelAdmin):
if instance.contact_email:
return instance.contact_email
elif instance.contact_mailinglist:
return instance.contact_mailinglist.name + '@thalia.nu'
return (f'{instance.contact_mailinglist.name}'
f'@{settings.SITE_DOMAIN}')
return None
......
......@@ -73,5 +73,6 @@ def notify_organiser(event, registration):
EmailMessage(
subject,
text_message,
to=[event.organiser.contact_mailinglist.name + "@thalia.nu"]
to=[f"{event.organiser.contact_mailinglist.name}"
f"@{settings.SITE_DOMAIN}"]
).send()
......@@ -2,6 +2,7 @@ import datetime
from django.contrib.auth.models import Permission
from django.core import mail
from django.conf import settings
from django.test import Client, TestCase, override_settings
from django.utils import timezone
......@@ -461,5 +462,6 @@ class RegistrationTest(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(self.event.participants.count(), 0)
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(mail.outbox[0].to, [self.event.organiser.
contact_mailinglist.name + "@thalia.nu"])
self.assertEqual(mail.outbox[0].to, [
f"{self.event.organiser.contact_mailinglist.name}"
f"@{settings.SITE_DOMAIN}"])
......@@ -18,7 +18,7 @@ def get_automatic_lists():
.select_related('member'))
committee_chairs = (_get_members_email_addresses(
[x.member for x in current_committee_chairs])
+ ['internalaffairs@thalia.nu'])
+ [f'internalaffairs@{settings.SITE_DOMAIN}'])
current_society_chairs = (MemberGroupMembership.active_objects
.filter(group__board=None)
......@@ -27,7 +27,7 @@ def get_automatic_lists():
.select_related('member'))
society_chair_emails = (_get_members_email_addresses(
[x.member for x in current_society_chairs])
+ ['internalaffairs@thalia.nu'])
+ [f'internalaffairs@{settings.SITE_DOMAIN}'])
active_committee_memberships = (MemberGroupMembership.active_objects
.filter(group__board=None)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment