Projet

Général

Profil

0001-registration-add-a-note-about-spams-27097.patch

Frédéric Péters, 01 juin 2019 13:21

Télécharger (3,46 ko)

Voir les différences:

Subject: [PATCH] registration: add a note about spams (#27097)

 .../registration/registration_complete.html   | 21 +++++++++++++++++--
 src/authentic2/views.py                       |  1 +
 tests/test_registration.py                    |  2 ++
 3 files changed, 22 insertions(+), 2 deletions(-)
src/authentic2/templates/registration/registration_complete.html
6 6
{% endblock %}
7 7

  
8 8
{% block content %}
9
  {% block instructions %}
9 10
  {% blocktrans with email=request.session.registered_email %}
10 11
    <p>An email was sent to {{ email }}.</p>
11 12
  {% endblocktrans %}
12 13
  {% if account_activation_days > 1 %}
13 14
  {% blocktrans %}
14
    <p>Follow instruction in this email to continue your registration, this
15
    <p>Follow the instructions in this email to continue your registration, this
15 16
    email will be valid during {{account_activation_days}} days.</p>
16 17
  {% endblocktrans %}
17 18
  {% else %}
18 19
  {% blocktrans %}
19
    <p>Follow instruction in this email to continue your registration, this
20
    <p>Follow the instructions in this email to continue your registration, this
20 21
    email will be valid during 24 hours.</p>
21 22
  {% endblocktrans %}
22 23
  {% endif %}
24
  {% endblock %}
25
  {% block advice %}
26
    {% blocktrans with from_email=from_email %}
27
    <p>To be sure to receive this email we recommend you to add the
28
    {{ from_email }} email address to your addressbook or list of authorised senders
29
    otherwise the message may end up in your spam folder.</p>
30
    {% endblocktrans %}
31
    {% blocktrans with from_email=from_email %}
32
    <p>If you cannot find the email you should check your spam folder and if
33
    you find it there you should mark it as "non-spam" and add the {{from_email }}
34
    address to your addressbook, this should prevent further emails to be
35
    sorted as spams.</p>
36
    {% endblocktrans %}
37
  {% endblock %}
38
  {% block back %}
23 39
  <p><a href="{{ next_url }}">{% trans "Back" %}</a></p>
40
  {% endblock %}
24 41
{% endblock %}
src/authentic2/views.py
1124 1124

  
1125 1125
    def get_context_data(self, **kwargs):
1126 1126
        kwargs['next_url'] = utils.select_next_url(self.request, settings.LOGIN_REDIRECT_URL)
1127
        kwargs['from_email'] = settings.DEFAULT_FROM_EMAIL
1127 1128
        return super(RegistrationCompleteView, self).get_context_data(
1128 1129
            account_activation_days=settings.ACCOUNT_ACTIVATION_DAYS,
1129 1130
            **kwargs)
tests/test_registration.py
54 54

  
55 55
    assert '2 days' in response.text
56 56
    assert 'testbot@entrouvert.com' in response.text
57
    assert 'spam folder' in response.text
58
    assert settings.DEFAULT_FROM_EMAIL in response.text
57 59
    assert len(mailoutbox) == 1
58 60

  
59 61
    link = get_link_from_mail(mailoutbox[0])
60
-