From 275e48681df35bedd732d2fe61e1ec971222b909 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 8 Jun 2020 19:48:05 +0000 Subject: [PATCH] Updated the email template that goes out for password setting on account creation, to give directions also for the case when the user already has a pre-existing account. Updated a test to match. - Legacy-Id: 17939 --- ietf/ietfauth/tests.py | 5 +++-- ietf/templates/registration/creation_email.txt | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ietf/ietfauth/tests.py b/ietf/ietfauth/tests.py index 9a6bb2a57..17093db63 100644 --- a/ietf/ietfauth/tests.py +++ b/ietf/ietfauth/tests.py @@ -6,6 +6,7 @@ import datetime import io import logging # pyflakes:ignore import os +import re import requests import requests_mock import shutil @@ -117,10 +118,10 @@ class IetfAuthTests(TestCase): def extract_confirm_url(self, confirm_email): # dig out confirm_email link msg = get_payload_text(confirm_email) - line_start = "http" + line_re = r"http.*/.*confirm" confirm_url = None for line in msg.split("\n"): - if line.strip().startswith(line_start): + if re.search(line_re, line.strip()): confirm_url = line.strip() self.assertTrue(confirm_url) diff --git a/ietf/templates/registration/creation_email.txt b/ietf/templates/registration/creation_email.txt index 5fe844a96..df42c05f3 100644 --- a/ietf/templates/registration/creation_email.txt +++ b/ietf/templates/registration/creation_email.txt @@ -1,12 +1,19 @@ {% autoescape off %}{% load ietf_filters %} Hello, -{% filter wordwrap:78 %}We have received an account creation request for {{ username }} at {{ domain }}. In order to set a new password for the {{ username }} account, please go to the following link and follow the instructions there:{% endfilter %} +{% filter wordwrap:78 %}We have received an account creation request for {{ username }} at {{ domain }}.{% endfilter %} + +{% filter wordwrap:78 %}If you do not already have datatracker account, please go to the following link and follow the instructions there in order to set a new password for the {{ username }} account:{% endfilter %} https://{{ domain }}{% url "ietf.ietfauth.views.confirm_account" auth %} This link will expire in {{ expire }} days. +{% filter wordwrap:78 %}If you already have a datatracker account, please go to the following link instead, and add the new email {{ username }} to your existing account:{% endfilter %} + + https://{{ domain }}{% url "ietf.ietfauth.views.profile" %} + + Best regards, The datatracker login manager service