Fix various problems with emails for account/password

This commit is contained in:
Rodolphe Breard 2018-02-04 16:11:07 +01:00
parent 9d989f0549
commit 291f9f0910
7 changed files with 44 additions and 17 deletions

View file

@ -107,7 +107,7 @@ EMAIL_HOST = os.getenv('KHAGANAT_EMAIL_HOST', default='localhost')
EMAIL_PORT = int(os.getenv('KHAGANAT_EMAIL_PORT', default='25'))
EMAIL_HOST_USER = os.getenv('KHAGANAT_EMAIL_HOST_USER', default='')
EMAIL_HOST_PASSWORD = os.getenv('KHAGANAT_EMAIL_HOST_PASSWORD', default='')
EMAIL_USE_TLS = os.getenv('KHAGANAT_EMAIL_USE_TLS', default='')
EMAIL_USE_TLS = get_config_bool('KHAGANAT_EMAIL_USE_TLS', default=False)
EMAIL_SUBJECT_PREFIX = os.getenv('KHAGANAT_EMAIL_SUBJECT_PREFIX', default='')
DEFAULT_FROM_EMAIL = os.getenv(

View file

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-04 01:03+0100\n"
"POT-Creation-Date: 2018-02-04 15:56+0100\n"
"PO-Revision-Date: 2018-02-04 01:03+0100\n"
"Last-Translator: Khaganat <assoc@khaganat.net>\n"
"Language-Team: Khaganat <assoc@khaganat.net>\n"
@ -100,6 +100,7 @@ msgstr "forgotten password"
#: templates/neluser/password_reset.html:4
#: templates/neluser/password_reset_confirm.html:4
#: templates/neluser/password_reset_done.html:4
#: templates/neluser/password_reset_email_sent.html:4
msgid "password_reset"
msgstr "password reset"
@ -136,6 +137,11 @@ msgstr ""
msgid "Please go to the following page and choose a new password:"
msgstr ""
#: templates/neluser/password_reset_email_sent.html:8
msgid "password_reset_success_email"
msgstr "An email has been sent to your address. Please follow the link given "
"in this email to reset your password."
#: templates/neluser/password_reset_email_subject.txt:2
#, python-format
msgid "Password reset on %(site_name)s"
@ -147,8 +153,9 @@ msgstr "Almost there…"
#: templates/neluser/register_done.html:10
msgid "activate_your_account"
msgstr "You now need to activate your account. Please click on the link that "
"has been sent to your email address."
msgstr ""
"You now need to activate your account. Please click on the link that has "
"been sent to your email address."
#: templates/neluser/register_done.html:11
msgid "take_me_home"

View file

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-04 01:03+0100\n"
"POT-Creation-Date: 2018-02-04 15:56+0100\n"
"PO-Revision-Date: 2018-02-04 01:03+0100\n"
"Last-Translator: Khaganat <assoc@khaganat.net>\n"
"Language-Team: Khaganat <assoc@khaganat.net>\n"
@ -68,8 +68,7 @@ msgstr "connexion"
#, python-format
msgid ""
"You're receiving this email because you created an account at %(site_name)s."
msgstr ""
"Vous recevez cet email car vous avez créé un compte sur %(site_name)s."
msgstr "Vous recevez cet email car vous avez créé un compte sur %(site_name)s."
#: templates/neluser/activate_email.html:7
#: templates/neluser/activate_email.txt:4
@ -103,6 +102,7 @@ msgstr "mot de passe oublié"
#: templates/neluser/password_reset.html:4
#: templates/neluser/password_reset_confirm.html:4
#: templates/neluser/password_reset_done.html:4
#: templates/neluser/password_reset_email_sent.html:4
msgid "password_reset"
msgstr "réinitialisation du mot de passe"
@ -139,7 +139,13 @@ msgstr ""
#: templates/neluser/password_reset_email.html:7
#: templates/neluser/password_reset_email.txt:4
msgid "Please go to the following page and choose a new password:"
msgstr "Veuillez suivre le lien suivant pour réinitialiser votre mot de passe :"
msgstr ""
"Veuillez suivre le lien suivant pour réinitialiser votre mot de passe :"
#: templates/neluser/password_reset_email_sent.html:8
msgid "password_reset_success_email"
msgstr "Un message a été envoyé sur votre messagerie électronique. Veuillez "
"suivre le lien donné dans ce message afin de réinitialiser votre mot de passe."
#: templates/neluser/password_reset_email_subject.txt:2
#, python-format
@ -152,8 +158,9 @@ msgstr "Vous y êtes presque…"
#: templates/neluser/register_done.html:10
msgid "activate_your_account"
msgstr "Vous devez maintenant activer votre compte. Veuillez cliquer sur le "
"lien qui vient d'être envoyé sur votre adresse électronique."
msgstr ""
"Vous devez maintenant activer votre compte. Veuillez cliquer sur le lien qui "
"vient d'être envoyé sur votre adresse électronique."
#: templates/neluser/register_done.html:11
msgid "take_me_home"

View file

@ -4,10 +4,10 @@
{% block title %}{% trans "register" %}{% endblock %}
{% block content %}
<div class="alert alert-success" role="alert">
<p>{% trans 'account_activated' %}</p>
<a class="btn btn-secondary" href="{% url "login" %}" role="button">{% trans "login"|capfirst %}</a>
<div class="content-bloc">
<div class="alert alert-success" role="alert">
<p>{% trans 'account_activated' %}</p>
<a class="btn btn-secondary" href="{% url "login" %}" role="button">{% trans "login"|capfirst %}</a>
</div>
</div>
{% endblock %}

View file

@ -5,6 +5,9 @@
{% block content %}
<div class="content-bloc">
<div class="alert alert-success" role="alert">{% trans "password_reset_success" %}</div>
<div class="alert alert-success" role="alert">
<p>{% trans "password_reset_success" %}</p>
<a class="btn btn-secondary" href="{% url "login" %}" role="button">{% trans "login"|capfirst %}</a>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,10 @@
{% extends "khaganat/base.html" %}
{% load i18n %}
{% block title %}{% trans "password_reset" %}{% endblock %}
{% block content %}
<div class="content-bloc">
<div class="alert alert-success" role="alert">{% trans "password_reset_success_email" %}</div>
</div>
{% endblock %}

View file

@ -43,7 +43,7 @@ urlpatterns = [
path(
'forgotten_password/done/',
auth_views.PasswordResetDoneView.as_view(
template_name='neluser/password_reset_done.html'
template_name='neluser/password_reset_email_sent.html'
),
name='password_reset_done'
),