diff --git a/openwisp_users/accounts/templates/account/email/password_expiration_message.html b/openwisp_users/accounts/templates/account/email/password_expiration_message.html index 86ffe826..5dd9052b 100644 --- a/openwisp_users/accounts/templates/account/email/password_expiration_message.html +++ b/openwisp_users/accounts/templates/account/email/password_expiration_message.html @@ -1,5 +1,6 @@ {% load i18n %} +{% load l10n %} -

{% blocktrans with expiry_date=expiry_date|date:"Y-m-d" %}We inform you that the password for your account {{ username }} will expire in 7 days, precisely on {{ expiry_date }}.{% endblocktrans %}

+

{% blocktrans with expiry_date=expiry_date|localize %}We inform you that the password for your account {{ username }} will expire in 7 days, precisely on {{ expiry_date }}.{% endblocktrans %}

{% trans "Kindly proceed with updating your password by clicking on the button below." %}

diff --git a/openwisp_users/accounts/templates/account/email/password_expiration_message.txt b/openwisp_users/accounts/templates/account/email/password_expiration_message.txt index 28003d9a..4e6597a8 100644 --- a/openwisp_users/accounts/templates/account/email/password_expiration_message.txt +++ b/openwisp_users/accounts/templates/account/email/password_expiration_message.txt @@ -1,5 +1,6 @@ {% load i18n %} +{% load l10n %} -{% blocktrans with expiry_date=expiry_date|date:"Y-m-d" %}We inform you that the password for your account {{ username }} will expire in 7 days, precisely on {{ expiry_date }}.{% endblocktrans %} +{% blocktrans with expiry_date=expiry_date|localize %}We inform you that the password for your account {{ username }} will expire in 7 days, precisely on {{ expiry_date }}.{% endblocktrans %} {% trans "Kindly proceed with updating your password by clicking on the button below." %} diff --git a/openwisp_users/tests/test_models.py b/openwisp_users/tests/test_models.py index 343d3613..2d602349 100644 --- a/openwisp_users/tests/test_models.py +++ b/openwisp_users/tests/test_models.py @@ -428,7 +428,7 @@ def test_password_expiration_mail(self): password_updated=user_expiry_date ) password_expiration_email.delay() - formatted_expiry_date = (now() + timedelta(days=7)).strftime('%Y-%m-%d') + formatted_expiry_date = (now() + timedelta(days=7)).strftime('%d %b %Y') self.assertEqual(len(mail.outbox), 1) email = mail.outbox.pop() self.assertEqual(email.to, [verified_email_user.email])