summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/authentic2/templates/authentic2/accounts_delete_request.html4
-rw-r--r--src/authentic2/templates/authentic2/unused_account_alert_body.html7
-rw-r--r--src/authentic2/templates/authentic2/unused_account_alert_subject.txt7
-rw-r--r--tests/test_commands.py3
4 files changed, 15 insertions, 6 deletions
diff --git a/src/authentic2/templates/authentic2/accounts_delete_request.html b/src/authentic2/templates/authentic2/accounts_delete_request.html
index 0ea3a83..9efcd9b 100644
--- a/src/authentic2/templates/authentic2/accounts_delete_request.html
+++ b/src/authentic2/templates/authentic2/accounts_delete_request.html
@@ -16,12 +16,12 @@
<form method="post">
{% csrf_token %}
<p>
- {% blocktrans %}
+ {% blocktrans trimmed %}
Do you really want to delete your account?
{% endblocktrans %}
</p>
<p>
- {% blocktrans %}
+ {% blocktrans trimmed %}
A validation message will be sent to {{ email }}. You will have to visit the
link in this email in order to complete the deletion process.
{% endblocktrans %}
diff --git a/src/authentic2/templates/authentic2/unused_account_alert_body.html b/src/authentic2/templates/authentic2/unused_account_alert_body.html
index f3a978b..65e52dc 100644
--- a/src/authentic2/templates/authentic2/unused_account_alert_body.html
+++ b/src/authentic2/templates/authentic2/unused_account_alert_body.html
@@ -1,6 +1,9 @@
-{% load i18n %}{% autoescape off %}{% blocktrans %}Hi {{ user.get_full_name }},
+{% load i18n humanize %}
+{% autoescape off %}
+{% blocktrans with last_login_date=user.last_login|naturaltime %}
+Hi {{ user.get_full_name }},
Your last logging was {{ last_login_date }}.
-In order to keep your account, you must <a href={{ login_url}}>log in</a> before {{ days_to_deletion }} days.
+In order to keep your account, you must <a href="{{ login_url }}">log in</a> within {{ days_to_deletion }} days.
Otherwise, it will be deleted after this time.
{% endblocktrans %}{% endautoescape %}
diff --git a/src/authentic2/templates/authentic2/unused_account_alert_subject.txt b/src/authentic2/templates/authentic2/unused_account_alert_subject.txt
index 30b8999..0649ed5 100644
--- a/src/authentic2/templates/authentic2/unused_account_alert_subject.txt
+++ b/src/authentic2/templates/authentic2/unused_account_alert_subject.txt
@@ -1 +1,6 @@
-{% load i18n %}{% autoescape off %}{% blocktrans %}Alert: {{ user }} you have not logged since {{ threshold }}{% endblocktrans %}{% endautoescape %}
+{% load i18n humanize %}
+{% autoescape off %}
+{% blocktrans trimmed with last_login_date=user.last_login|naturaltime %}
+Alert: {{ user.get_full_name }} your last login was {{ last_login_date }}
+{% endblocktrans %}
+{% endautoescape %}
diff --git a/tests/test_commands.py b/tests/test_commands.py
index a57230d..61800d2 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -143,6 +143,7 @@ def test_clean_unused_account_human_duration_format(simple_user, mailoutbox, del
management.call_command('clean-unused-accounts')
mail = mailoutbox[0]
assert formatted in mail.body
+ assert formatted in mail.subject and not '\n' in mail.subject
# deletion email
simple_user.last_account_deletion_alert = now() - datetime.timedelta(days=2)
@@ -160,7 +161,7 @@ def test_clean_unused_account_login_url(simple_user, mailoutbox):
simple_user.save()
management.call_command('clean-unused-accounts')
mail = mailoutbox[0]
- assert 'href=http://localhost/login' in mail.message().as_string()
+ assert 'href="http://localhost/login/"' in mail.message().as_string()
def test_cleanupauthentic(db):