Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix email template

Marek Brzóska7db9c40cdba8
diff --git a/registration/forms.py b/registration/forms.py
index f9e31449b7..491b78b05d 100644
--- a/registration/forms.py
+++ b/registration/forms.py
@@ -30,7 +30,7 @@ class RequestEmailConfirmationForm(forms.Form):
email = forms.EmailField()
- template = 'registration/email/confirm_email.txt'
+ template = 'registration/emails/confirm_email.txt'
def __init__(self, local_host=None, data=None):
self.local_host = local_host
@@ -52,9 +52,7 @@ class RequestEmailConfirmationForm(forms.Form):
class RequestEmailChangeForm(RequestEmailConfirmationForm):
- email = forms.EmailField()
-
- template = 'registration/email/change_email.txt'
+ template = 'registration/emails/change_email.txt'
def __init__(self, user=None, *args, **kwargs):
self.user = user
diff --git a/registration/templates/registration/email/change_email.txt b/registration/templates/registration/emails/change_email.txt
similarity index 56%
rename from registration/templates/registration/email/change_email.txt
rename to registration/templates/registration/emails/change_email.txt
index 680e311761..fc27738756 100644
--- a/registration/templates/registration/email/change_email.txt
+++ b/registration/templates/registration/emails/change_email.txt
@@ -1,4 +1,8 @@
-Hi!
+{% load i18n %}
+
+{% block subject %}{% trans "Confirm your email address" %}{% endblock %}
+
+{% block text %}{% blocktrans %}Hi!
You have requested email change in saleor project. To continue visit the link below.
@@ -7,4 +11,4 @@ You have requested email change in saleor project. To continue visit the link be
If you didn't mean to change your email please ignore this message. We apologise for inconvenience.
Sincerely,
-Saleor Team
+Saleor Team{% endblocktrans %}{% endblock %}
diff --git a/registration/tests.py b/registration/tests.py
index d3e5e7e63e..293e0f4539 100644
--- a/registration/tests.py
+++ b/registration/tests.py
@@ -298,7 +298,7 @@ class EmailChangeTestCase(TestCase):
get.assert_called_once_with(
token=token_object.token, valid_until__gte=now())
self.assertFalse(request.user.is_authenticated())
- self.assertEqual(token_object.delete.call_count, 0)
+ token_object.delete.assert_not_called()
@patch('registration.views.now')
@patch('registration.views.EmailChangeRequest.objects.get')