diff --git a/opentech/apply/users/templates/users/activation/email.txt b/opentech/apply/users/templates/users/activation/email.txt index aebd8a8aabab32e65d0e724437b86576be187f43..17f2e898a2ca9e42919042e163225ea52b748453 100644 --- a/opentech/apply/users/templates/users/activation/email.txt +++ b/opentech/apply/users/templates/users/activation/email.txt @@ -6,7 +6,7 @@ An account on the Open Technology Fund web site has been created. Activate your {% if site %}{{ site.root_url }}{% else %}{{ base_url }}{% endif %}{{ activation_path }} -This link can be used once to log in and will lead you to a page where you can set your password. +This link can be used only once and will lead you to a page where you can set your password. It will remain active for {{ timeout_days }} days, so do it now. After setting your password, you will be able to log in at {% if site %}{{ site.root_url }}{% else %}{{ base_url }}{% endif %} in the future using: diff --git a/opentech/apply/users/templates/users/activation/invalid.html b/opentech/apply/users/templates/users/activation/invalid.html index df12380a7ae5089993432b54a7a3201050afc583..1d3deb8269418687034096aefe9679dd364b627f 100644 --- a/opentech/apply/users/templates/users/activation/invalid.html +++ b/opentech/apply/users/templates/users/activation/invalid.html @@ -1,7 +1,17 @@ {% extends 'base.html' %} +{% load i18n %} -{% block title %}Invalid activation{% endblock %} +{% block title %}{% trans "Invalid activation" %}{% endblock %} +{% block page_title %}{% trans "Invalid activation URL" %}{% endblock %} {% block content %} - <h2>Invalid activation URL</h2> +<div class="wrapper wrapper--small wrapper--bottom-space"> + <p><strong>Two possible reasons:</strong></p> + <ul> + <li>The activation link has expired.</li> + <li>The account has already been activated.</li> + </ul> + + <p>First test to <a href="{% url 'users:password_reset' %}">reset your password</a>. If that fails please contact OTF at <a href="mailto:hello@opentech.fund">hello@opentech.fund</a></p> +</div> {% endblock %} diff --git a/opentech/apply/users/templates/users/password_reset/complete.html b/opentech/apply/users/templates/users/password_reset/complete.html index fb4f06aa4280585f99ae7d1d606bc68b4ce26567..b826a0ef92bb1e4d6a72622450685fe7c570429b 100644 --- a/opentech/apply/users/templates/users/password_reset/complete.html +++ b/opentech/apply/users/templates/users/password_reset/complete.html @@ -1,9 +1,13 @@ {% extends "base.html" %} {% load i18n %} -{% block title %}{% trans "Reset password" %}{% endblock %} {% block content %} - <h1>{% trans "Password change successful" %}</h1> +{% block title %}{% trans "Reset password" %}{% endblock %} +{% block page_title %}{% trans "Password change successful" %}{% endblock %} + +{% block content %} +<div class="wrapper wrapper--small wrapper--bottom-space"> <p> <a href="{% url 'users_public:login' %}">{% trans "Log in" %}</a> </p> +</div> {% endblock %} diff --git a/opentech/apply/users/templates/users/password_reset/done.html b/opentech/apply/users/templates/users/password_reset/done.html index 24b43492ef854ecd33e7e54d8a42c0a6b322342f..e7399783407b3159c4a6288cdb4937a4434f17b6 100644 --- a/opentech/apply/users/templates/users/password_reset/done.html +++ b/opentech/apply/users/templates/users/password_reset/done.html @@ -5,7 +5,7 @@ {% block title %}{% trans "Reset password" %}{% endblock %} {% block content %} - <div class="wrapper wrapper--small wrapper--bottom-space"> - <p>{% trans "A link to reset your password has been emailed to you." %}</p> - </div> +<div class="wrapper wrapper--small wrapper--bottom-space"> + <p>{% trans "A link to reset your password has been emailed to you." %}</p> +</div> {% endblock %} diff --git a/opentech/apply/users/templates/users/password_reset/form.html b/opentech/apply/users/templates/users/password_reset/form.html index 8075376a73e252951ae02d4ef7bff30b04960cd4..a50f15a58682397e73ce76f1c2df0b57253941c2 100644 --- a/opentech/apply/users/templates/users/password_reset/form.html +++ b/opentech/apply/users/templates/users/password_reset/form.html @@ -1,28 +1,28 @@ {% extends 'base.html' %} {% load i18n %} + {% block header_modifier %}header--light-bg{% endblock %} {% block page_title %}Reset password{% endblock %} {% block title %}{% trans "Reset password" %}{% endblock %} - {% block content %} - <div class="wrapper wrapper--small wrapper--bottom-space"> - {% if form.non_field_errors %} - <div class="messages"> - <ul> - {% for error in form.non_field_errors %} - <li class="error">{{ error }}</li> - {% endfor %} - </ul> - </div> - {% endif %} +<div class="wrapper wrapper--small wrapper--bottom-space"> + {% if form.non_field_errors %} + <div class="messages"> + <ul> + {% for error in form.non_field_errors %} + <li class="error">{{ error }}</li> + {% endfor %} + </ul> + </div> + {% endif %} - <form class="form form--with-p-tags" method="post"> - {% csrf_token %} - <p>{{ form.email.label_tag }}</p> - <p>{{ form.email }}</p> + <form class="form form--with-p-tags" method="post"> + {% csrf_token %} + <p>{{ form.email.label_tag }}</p> + <p>{{ form.email }}</p> - <button class="link link--button-secondary" type="submit">{% trans 'Reset password' %}</button> - </form> - </div> + <button class="link link--button-secondary" type="submit">{% trans 'Reset password' %}</button> + </form> +</div> {% endblock %} diff --git a/opentech/apply/users/utils.py b/opentech/apply/users/utils.py index 7539e137f579da23f11c50150e0c0dc1fdf9676a..74142ec7131ce70e93f66c2310e65259d3e43d7e 100644 --- a/opentech/apply/users/utils.py +++ b/opentech/apply/users/utils.py @@ -38,6 +38,7 @@ def send_activation_email(user, site=None): 'name': user.get_full_name(), 'username': user.get_username(), 'activation_path': activation_path, + 'timeout_days': settings.PASSWORD_RESET_TIMEOUT_DAYS, } if site: diff --git a/opentech/settings/base.py b/opentech/settings/base.py index e2157aecbcae27912724a158ffa0f1e0ef98c85d..06bddd79aa2591f73a63772470bdbdac59683495 100644 --- a/opentech/settings/base.py +++ b/opentech/settings/base.py @@ -248,6 +248,8 @@ AUTH_PASSWORD_VALIDATORS = [ }, ] +# Number of days that password reset and account activation links are valid (default 3). +PASSWORD_RESET_TIMEOUT_DAYS = 8 # Internationalization # https://docs.djangoproject.com/en/stable/topics/i18n/