Verified Commit 0197d331 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Replace all mentions of thalia.nu by the BASE_URL

parent a393f6e9
......@@ -2,6 +2,7 @@
import datetime
import logging
from django.conf import settings
from django.contrib.auth.models import Permission
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
from django.core.validators import MinValueValidator
......@@ -102,7 +103,7 @@ class MemberGroup(models.Model, metaclass=ModelTranslateMeta):
@property
def contact_address(self):
if self.contact_mailinglist:
return f"{self.contact_mailinglist.name}@thalia.nu"
return f"{self.contact_mailinglist.name}@{settings.SITE_DOMAIN}"
return self.contact_email
def clean(self):
......
"""The feeds defined by the events package"""
from django.conf import settings
from django.db.models.query_utils import Q
from django.contrib.sites.models import Site
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.utils.translation import activate
from django.utils.translation import ugettext as _
from django_ical.views import ICalFeed
from events.models import Event, FeedToken
......@@ -25,7 +25,7 @@ class EventFeed(ICalFeed):
return super().__call__(request, args, kwargs)
def product_id(self):
return '-//thalia.nu//EventCalendar//' + self.lang.upper()
return f'-//{settings.SITE_DOMAIN}//EventCalendar//{self.lang.upper()}'
def file_name(self):
return "thalia_{}.ics".format(self.lang)
......@@ -47,10 +47,8 @@ class EventFeed(ICalFeed):
return item.title
def item_description(self, item):
return (item.description +
' <a href="https://%s%s">Website</a>' %
(Site.objects.get_current().domain,
self.item_link(item)))
return (f'{item.description} <a href="https://'
f'{self.item_link(item)}">Website</a>')
def item_start_datetime(self, item):
return item.start
......@@ -59,7 +57,10 @@ class EventFeed(ICalFeed):
return item.end
def item_link(self, item):
return reverse('events:event', kwargs={'pk': item.id})
return (
settings.BASE_URL +
reverse('events:event', kwargs={'pk': item.id})
)
def item_location(self, item):
return "{} - {}".format(item.location, item.map_location)
......@@ -183,7 +183,8 @@ def send_welcome_message(user, password, language):
{
'full_name': user.get_full_name(),
'username': user.username,
'password': password
'password': password,
'url': settings.BASE_URL
})
user.email_user(
_('Welcome to Study Association Thalia'),
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-03 19:25+0200\n"
"PO-Revision-Date: 2019-04-03 19:30+0200\n"
"POT-Creation-Date: 2019-04-09 21:17+0200\n"
"PO-Revision-Date: 2019-04-09 21:18+0200\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
"Language: nl\n"
......@@ -90,6 +90,20 @@ msgstr "Studentnummer"
msgid "Download student number label for selected users"
msgstr "Download studentnummers voor geselecteerde gebruikers"
#: admin.py
msgid "Data minimisation could not be executed for the selected user(s)."
msgstr ""
"Gegevensminimisatie kon niet worden uitgevoerd voor de geselecteerde "
"gebruiker(s)."
#: admin.py
msgid "Data minimisation was executed for {} user(s)."
msgstr "Gegevensminimisatie is uitgevoerd voor {} gebruiker(s)."
#: admin.py
msgid "Minimise data for the selected users"
msgstr "Minimiseer gegevens voor de geselecteerde gebruikers"
#: apps.py
msgid "Members"
msgstr "Leden"
......@@ -883,7 +897,7 @@ msgid ""
"Dear %(full_name)s,\n"
"\n"
"Welcome to Study Association Thalia! You now have an account and can\n"
"log in at https://thalia.nu/.\n"
"log in at %(url)s.\n"
"\n"
"Your username is: %(username)s\n"
"Your password is: %(password)s\n"
......@@ -901,7 +915,7 @@ msgstr ""
"Beste %(full_name)s,\n"
"\n"
"Welkom bij Studievereniging Thalia! Je hebt nu een account zodat \n"
"je kunt inloggen op https://thalia.nu/.\n"
"je kunt inloggen op %(url)s.\n"
"\n"
"Dit zijn je gebruikersnaam en wachtwoord: \n"
"Je gebruikersnaam is: %(username)s\n"
......
{% load i18n %}{% blocktrans %}Dear {{ full_name }},
Welcome to Study Association Thalia! You now have an account and can
log in at https://thalia.nu/.
log in at {{ url }}.
Your username is: {{ username }}
Your password is: {{ password }}
......
......@@ -81,8 +81,9 @@ def send_new_registration_board_message(entry):
'registrations/email/registration_board.txt',
{
'name': entry.registration.get_full_name(),
'url': reverse('admin:registrations_registration_change',
args=[entry.registration.pk])
'url': settings.BASE_URL
+ reverse('admin:registrations_registration_change',
args=[entry.registration.pk])
}
)
except models.Registration.DoesNotExist:
......@@ -154,8 +155,9 @@ def send_new_renewal_board_message(renewal):
'registrations/email/renewal_board.txt',
{
'name': renewal.member.get_full_name(),
'url': reverse('admin:registrations_renewal_change',
args=[renewal.pk])
'url': settings.BASE_URL
+ reverse('admin:registrations_renewal_change',
args=[renewal.pk])
}
)
......
......@@ -3,7 +3,7 @@ Dear board,
A new membership registration has been submitted by {{ name }}.
Open the following url to review this submission:
https://thalia.nu{{ url }}
{{ url }}
Kisses,
......
......@@ -3,7 +3,7 @@ Dear board,
A new membership renewal has been submitted by {{ name }}.
Open the following url to review this submission:
https://thalia.nu{{ url }}
{{ url }}
Kisses,
......
......@@ -38,10 +38,10 @@ class EmailsTest(TestCase):
'registrations/email/registration_confirm_mail.txt',
{
'name': reg.get_full_name(),
'confirm_link': '{}{}'.format(
'https://thalia.nu',
reverse('registrations:confirm-email',
args=[reg.pk])
'confirm_link': (
'https://thalia.localhost'
+ reverse("registrations:confirm-email",
args=[reg.pk])
)
}
)
......@@ -114,8 +114,11 @@ class EmailsTest(TestCase):
'registrations/email/registration_board.txt',
{
'name': entry.registration.get_full_name(),
'url': reverse('admin:registrations_registration_change',
args=[entry.registration.pk])
'url': (
'https://thalia.localhost'
+ reverse('admin:registrations_registration_change',
args=[entry.registration.pk])
)
}
)
......@@ -235,8 +238,11 @@ class EmailsTest(TestCase):
'registrations/email/renewal_board.txt',
{
'name': renewal.member.get_full_name(),
'url': reverse('admin:registrations_renewal_change',
args=[renewal.pk])
'url': (
'https://thalia.localhost'
+ reverse('admin:registrations_renewal_change',
args=[renewal.pk])
)
}
)
......
......@@ -205,9 +205,11 @@ class RegistrationTest(TestCase):
with self.subTest(f'Create confirmation mail'
f'on save with status confirm'):
self.assertEqual(len(mail.outbox), 1)
confirm_url = '{}{}'.format('https://thalia.nu',
reverse('registrations:confirm-email',
args=[registration.pk]))
confirm_url = (
'https://thalia.localhost' +
reverse('registrations:confirm-email',
args=[registration.pk])
)
self.assertTrue(confirm_url in mail.outbox[0].body)
mail.outbox.clear()
......
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