From: Yoan Le Clanche Date: Thu, 1 Sep 2022 09:13:32 +0000 (+0200) Subject: Fix issue with password reset template loading : https://trackers.pilotsystems.net... X-Git-Tag: 2.8.1-pro~84^2~1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bac4467e7e176e537a2e2394b58ca899e611a87c;p=teleforma.git Fix issue with password reset template loading : https://trackers.pilotsystems.net/prebarreau/0488 --- diff --git a/teleforma/templates/registration/logged_out.html b/teleforma/templates/registration/logged_out.html deleted file mode 100644 index 943c28b0..00000000 --- a/teleforma/templates/registration/logged_out.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "teleforma/base.html" %} -{% load i18n %} - -{% block content %} - -

{% trans "Thanks for spending some quality time with the Web site today." %}

- -

{% trans 'Log in again' %}

- -{% endblock %} diff --git a/teleforma/templates/registration/password_change_done.html b/teleforma/templates/registration/password_change_done.html deleted file mode 100644 index 8789e287..00000000 --- a/teleforma/templates/registration/password_change_done.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "teleforma/base.html" %} -{% load i18n %} -{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}{% trans 'Documentation' %} / {% endif %}{% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} - -{% block title %}
{% trans 'Password change successful' %}{% endblock %} - -{% block content %} - -

{% trans 'Your password was changed.' %}

- -{% endblock %} diff --git a/teleforma/templates/registration/password_change_form.html b/teleforma/templates/registration/password_change_form.html deleted file mode 100644 index e994011c..00000000 --- a/teleforma/templates/registration/password_change_form.html +++ /dev/null @@ -1,49 +0,0 @@ -{% extends "teleforma/base.html" %} -{% load i18n adminmedia %} -{% block extrastyle %}{{ block.super }}{% endblock %} -{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}{% trans 'Documentation' %} / {% endif %} {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} - -{% block title %}
{% trans 'Password change' %}{% endblock %} - -{% block content %}
- -
{% csrf_token %} -
-{% if form.errors %} -

- {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} -

-{% endif %} - -

{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}

- -
- -
- {{ form.old_password.errors }} - {{ form.old_password }} -
- -
- {{ form.new_password1.errors }} - {{ form.new_password1 }} -
- -
-{{ form.new_password2.errors }} - {{ form.new_password2 }} -
- -
- -
- - - -
-
- -{% endblock %} diff --git a/teleforma/templates/registration/password_reset_complete.html b/teleforma/templates/registration/password_reset_complete.html deleted file mode 100644 index b2343a3c..00000000 --- a/teleforma/templates/registration/password_reset_complete.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "teleforma/base.html" %} -{% load i18n %} - -{% block title %}
{% trans 'Password reset complete' %}{% endblock %} - -{% block content %} -

{% trans "Your password has been set. You may go ahead and log in now." %}

- -
-

-{% endblock %} diff --git a/teleforma/templates/registration/password_reset_confirm.html b/teleforma/templates/registration/password_reset_confirm.html deleted file mode 100644 index 57bea4b6..00000000 --- a/teleforma/templates/registration/password_reset_confirm.html +++ /dev/null @@ -1,28 +0,0 @@ -{% extends "teleforma/base.html" %} -{% load i18n %} - -{% block title %}
{% trans 'Password reset' %}{% endblock %} - -{% block content %} -{% if validlink %} -

{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}

- -
- -
{% csrf_token %} - - - -
{{ form.new_password1.errors }}

{{ form.new_password1 }}

{{ form.new_password2.errors }} -

{{ form.new_password2 }}

- -

-

{% trans 'Change my password' %}

-
- -{% else %} -

{% trans 'Password reset unsuccessful' %}

-

{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}

- -{% endif %} -{% endblock %} diff --git a/teleforma/templates/registration/password_reset_done.html b/teleforma/templates/registration/password_reset_done.html deleted file mode 100644 index c0ff509d..00000000 --- a/teleforma/templates/registration/password_reset_done.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "teleforma/base.html" %} -{% load i18n %} - -{% block title %}
{% trans "Password reset successful" %}{% endblock %} - -{% block content %} - -

Nous vous avons envoyé un mail contenant les instructions pour mettre à jour votre mot de passe. Vous devriez le recevoir sous peu.

-{% endblock %} diff --git a/teleforma/templates/registration/password_reset_email.html b/teleforma/templates/registration/password_reset_email.html deleted file mode 100644 index 715e4fa9..00000000 --- a/teleforma/templates/registration/password_reset_email.html +++ /dev/null @@ -1,15 +0,0 @@ -{% load teleforma_tags %}{% load i18n %}{% autoescape off %}{% trans "Hello" %}, - -{% trans "You're receiving this e-mail because you requested a password reset" %} -{% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}. - -{% trans "Please go to the following page and choose a new password:" %} -{% block reset_link %} -{{ protocol }}://{{ domain }}{% url 'teleforma-password-reset-confirm' uidb64=uid token=token %} -{% endblock %} -{% trans "Your username, in case you've forgotten:" %} {{ user.username }} - -{% trans "Best regards" %}, -{% trans "The site administrator" %} {% trans "of the" %} {% organization %} - -{% endautoescape %} diff --git a/teleforma/templates/registration/password_reset_form.html b/teleforma/templates/registration/password_reset_form.html deleted file mode 100644 index a297f988..00000000 --- a/teleforma/templates/registration/password_reset_form.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "teleforma/base.html" %} -{% load i18n %} - -{% block title %}
{% trans "Password reset" %}{% endblock %} - -{% block content %} -

{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}

- -
{% csrf_token %} -{{ form.email.errors }} -

{{ form.email }} {% trans 'Reset my password' %}

-
-{% endblock %} diff --git a/teleforma/templates/teleforma_registration/password_change_done.html b/teleforma/templates/teleforma_registration/password_change_done.html new file mode 100644 index 00000000..8789e287 --- /dev/null +++ b/teleforma/templates/teleforma_registration/password_change_done.html @@ -0,0 +1,11 @@ +{% extends "teleforma/base.html" %} +{% load i18n %} +{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}{% trans 'Documentation' %} / {% endif %}{% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} + +{% block title %}
{% trans 'Password change successful' %}{% endblock %} + +{% block content %} + +

{% trans 'Your password was changed.' %}

+ +{% endblock %} diff --git a/teleforma/templates/teleforma_registration/password_change_form.html b/teleforma/templates/teleforma_registration/password_change_form.html new file mode 100644 index 00000000..e994011c --- /dev/null +++ b/teleforma/templates/teleforma_registration/password_change_form.html @@ -0,0 +1,49 @@ +{% extends "teleforma/base.html" %} +{% load i18n adminmedia %} +{% block extrastyle %}{{ block.super }}{% endblock %} +{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}{% trans 'Documentation' %} / {% endif %} {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} + +{% block title %}
{% trans 'Password change' %}{% endblock %} + +{% block content %}
+ +
{% csrf_token %} +
+{% if form.errors %} +

+ {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} +

+{% endif %} + +

{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}

+ +
+ +
+ {{ form.old_password.errors }} + {{ form.old_password }} +
+ +
+ {{ form.new_password1.errors }} + {{ form.new_password1 }} +
+ +
+{{ form.new_password2.errors }} + {{ form.new_password2 }} +
+ +
+ +
+ + + +
+
+ +{% endblock %} diff --git a/teleforma/templates/teleforma_registration/password_reset_complete.html b/teleforma/templates/teleforma_registration/password_reset_complete.html new file mode 100644 index 00000000..b2343a3c --- /dev/null +++ b/teleforma/templates/teleforma_registration/password_reset_complete.html @@ -0,0 +1,11 @@ +{% extends "teleforma/base.html" %} +{% load i18n %} + +{% block title %}
{% trans 'Password reset complete' %}{% endblock %} + +{% block content %} +

{% trans "Your password has been set. You may go ahead and log in now." %}

+ +
+

+{% endblock %} diff --git a/teleforma/templates/teleforma_registration/password_reset_confirm.html b/teleforma/templates/teleforma_registration/password_reset_confirm.html new file mode 100644 index 00000000..57bea4b6 --- /dev/null +++ b/teleforma/templates/teleforma_registration/password_reset_confirm.html @@ -0,0 +1,28 @@ +{% extends "teleforma/base.html" %} +{% load i18n %} + +{% block title %}
{% trans 'Password reset' %}{% endblock %} + +{% block content %} +{% if validlink %} +

{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}

+ +
+ +
{% csrf_token %} + + + +
{{ form.new_password1.errors }}

{{ form.new_password1 }}

{{ form.new_password2.errors }} +

{{ form.new_password2 }}

+ +

+

{% trans 'Change my password' %}

+
+ +{% else %} +

{% trans 'Password reset unsuccessful' %}

+

{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}

+ +{% endif %} +{% endblock %} diff --git a/teleforma/templates/teleforma_registration/password_reset_done.html b/teleforma/templates/teleforma_registration/password_reset_done.html new file mode 100644 index 00000000..c0ff509d --- /dev/null +++ b/teleforma/templates/teleforma_registration/password_reset_done.html @@ -0,0 +1,9 @@ +{% extends "teleforma/base.html" %} +{% load i18n %} + +{% block title %}
{% trans "Password reset successful" %}{% endblock %} + +{% block content %} + +

Nous vous avons envoyé un mail contenant les instructions pour mettre à jour votre mot de passe. Vous devriez le recevoir sous peu.

+{% endblock %} diff --git a/teleforma/templates/teleforma_registration/password_reset_email.html b/teleforma/templates/teleforma_registration/password_reset_email.html new file mode 100644 index 00000000..715e4fa9 --- /dev/null +++ b/teleforma/templates/teleforma_registration/password_reset_email.html @@ -0,0 +1,15 @@ +{% load teleforma_tags %}{% load i18n %}{% autoescape off %}{% trans "Hello" %}, + +{% trans "You're receiving this e-mail because you requested a password reset" %} +{% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}. + +{% trans "Please go to the following page and choose a new password:" %} +{% block reset_link %} +{{ protocol }}://{{ domain }}{% url 'teleforma-password-reset-confirm' uidb64=uid token=token %} +{% endblock %} +{% trans "Your username, in case you've forgotten:" %} {{ user.username }} + +{% trans "Best regards" %}, +{% trans "The site administrator" %} {% trans "of the" %} {% organization %} + +{% endautoescape %} diff --git a/teleforma/templates/teleforma_registration/password_reset_form.html b/teleforma/templates/teleforma_registration/password_reset_form.html new file mode 100644 index 00000000..a297f988 --- /dev/null +++ b/teleforma/templates/teleforma_registration/password_reset_form.html @@ -0,0 +1,13 @@ +{% extends "teleforma/base.html" %} +{% load i18n %} + +{% block title %}
{% trans "Password reset" %}{% endblock %} + +{% block content %} +

{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}

+ +
{% csrf_token %} +{{ form.email.errors }} +

{{ form.email }} {% trans 'Reset my password' %}

+
+{% endblock %} diff --git a/teleforma/urls.py b/teleforma/urls.py index b0de2608..15541154 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -75,18 +75,18 @@ urlpatterns = [ # Registration # Registration - url(r'^accounts/password_change/$', PasswordChangeView.as_view(template_name='registration/password_change_form.html'), + url(r'^accounts/password_change/$', PasswordChangeView.as_view(template_name='teleforma_registration/password_change_form.html'), name="teleforma-password-change"), url(r'^accounts/password_change_done/$', PasswordChangeDoneView.as_view( - template_name='registration/password_change_done.html'), name="password_change_done"), + template_name='teleforma_registration/password_change_done.html'), name="password_change_done"), - url(r'^accounts/password_reset/$', PasswordResetView.as_view(template_name='registration/password_reset_form.html', - email_template_name='registration/password_reset_email.html'), name="teleforma-password-reset"), + url(r'^accounts/password_reset/$', PasswordResetView.as_view(template_name='teleforma_registration/password_reset_form.html', + email_template_name='teleforma_registration/password_reset_email.html'), name="teleforma-password-reset"), url(r'^accounts/password_reset_done/$', PasswordResetDoneView.as_view( - template_name='registration/password_reset_done.html'), name="password_reset_done"), + template_name='teleforma_registration/password_reset_done.html'), name="password_reset_done"), path('accounts/password_reset_confirm///', PasswordResetConfirmView.as_view( - template_name='registration/password_reset_confirm.html'), name="teleforma-password-reset-confirm"), - url(r'^accounts/password_reset_complete/$', PasswordResetCompleteView.as_view(template_name='registration/password_reset_complete.html'), + template_name='teleforma_registration/password_reset_confirm.html'), name="teleforma-password-reset-confirm"), + url(r'^accounts/password_reset_complete/$', PasswordResetCompleteView.as_view(template_name='teleforma_registration/password_reset_complete.html'), name="password_reset_complete"), # url(r'^captcha/', include('captcha.urls')),