Commit 8eed47ec authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix user variable in welcome email

parent dd7e4073
......@@ -4,7 +4,7 @@ from django import forms
from django.contrib.auth.models import User
from django.template import loader
from django.utils import translation
from django.utils.translation import ugettext as t
from django.utils.translation import ugettext
from django.utils.translation import ugettext_lazy as _
from .models import Member
......@@ -50,9 +50,13 @@ class UserCreationForm(forms.ModelForm):
with translation.override(language):
email_body = loader.render_to_string(
'members/email/welcome.txt',
{'user': user, 'password': password})
{
'full_name': user.get_full_name(),
'username': user.username,
'password': password
})
user.email_user(
t('Welkom bij Studievereniging Thalia'),
ugettext('Welcome to Study Association Thalia'),
email_body)
return user
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-07 20:57+0100\n"
"PO-Revision-Date: 2016-12-07 20:57+0100\n"
"POT-Creation-Date: 2016-12-19 21:27+0100\n"
"PO-Revision-Date: 2016-12-19 21:28+0100\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n"
"Language: nl\n"
......@@ -50,6 +50,10 @@ msgstr "Stuur welkomste-mails"
msgid "This email will include the generated password"
msgstr "Deze e-mail zal het gegenereerde wachtwoord bevatten"
#: forms.py:59
msgid "Welcome to Study Association Thalia"
msgstr "Welkom bij Studievereniging Thalia"
#: models.py:55
msgid "Computing Science"
msgstr "Informatica"
......@@ -378,15 +382,14 @@ msgstr "opslaan"
#: templates/members/email/welcome.txt:1
#, python-format
msgid ""
"Dear %(user.get_full_name)s, Welcome to Study Association Thalia! You now "
"have an account and can log in at https://thalia.nu/. This is your username "
"and password: Your username is: %(user.username)s Your password is: "
"%(password)s Please also check the information on your profile. Cheers, "
"Thalia"
"Dear %(full_name)s, Welcome to Study Association Thalia! You now have an "
"account and can log in at https://thalia.nu/. This is your username and "
"password: Your username is: %(username)s Your password is: %(password)s "
"Please also check the information on your profile. Cheers, Thalia"
msgstr ""
"Beste %(user.get_full_name)s, Welkom bij Studievereniging Thalia! Je hebt nu "
"een account zodat je kunt inloggen op https://thalia.nu/. Dit zijn je "
"gebruikersnaam en wachtwoord: Je gebruikersnaam is: %(user.username)s Je "
"Beste %(full_name)s, Welkom bij Studievereniging Thalia! Je hebt nu een "
"account zodat je kunt inloggen op https://thalia.nu/. Dit zijn je "
"gebruikersnaam en wachtwoord: Je gebruikersnaam is: %(username)s Je "
"wachtwoord: %(password)s Controleer alsjeblieft ook de gegevens in je "
"profiel. Groetjes, Thalia"
......
{% load i18n %}{% blocktrans trimmed %}Dear {{ user.get_full_name }},
{% load i18n %}{% blocktrans trimmed %}Dear {{ full_name }},
Welcome to Study Association Thalia! You now have an account and can
log in at https://thalia.nu/. This is your username and password:
Your username is: {{ user.username }}
Your username is: {{ username }}
Your password is: {{ password }}
Please also check the information on your profile.
......
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