From 9b05b1060171bf99325140601b8848e7d30d3a7e Mon Sep 17 00:00:00 2001 From: kiblik <5609770+kiblik@users.noreply.github.com> Date: Fri, 21 Jun 2024 23:24:43 +0200 Subject: [PATCH] fix(passwords): Merge clean location of login related templates (#10340) --- .../mail => login}/forgot_password.tpl | 0 dojo/templates/{dojo => login}/forgot_username.html | 0 .../mail => login}/forgot_username.tpl | 0 .../{dojo => login}/forgot_username_done.html | 0 .../{dojo => login}/forgot_username_subject.html | 0 dojo/templates/{dojo => login}/password_reset.html | 0 .../{dojo => login}/password_reset_complete.html | 0 .../{dojo => login}/password_reset_confirm.html | 0 .../{dojo => login}/password_reset_done.html | 0 dojo/user/urls.py | 12 ++++++------ dojo/user/views.py | 6 +++--- 11 files changed, 9 insertions(+), 9 deletions(-) rename dojo/templates/{notifications/mail => login}/forgot_password.tpl (100%) rename dojo/templates/{dojo => login}/forgot_username.html (100%) rename dojo/templates/{notifications/mail => login}/forgot_username.tpl (100%) rename dojo/templates/{dojo => login}/forgot_username_done.html (100%) rename dojo/templates/{dojo => login}/forgot_username_subject.html (100%) rename dojo/templates/{dojo => login}/password_reset.html (100%) rename dojo/templates/{dojo => login}/password_reset_complete.html (100%) rename dojo/templates/{dojo => login}/password_reset_confirm.html (100%) rename dojo/templates/{dojo => login}/password_reset_done.html (100%) diff --git a/dojo/templates/notifications/mail/forgot_password.tpl b/dojo/templates/login/forgot_password.tpl similarity index 100% rename from dojo/templates/notifications/mail/forgot_password.tpl rename to dojo/templates/login/forgot_password.tpl diff --git a/dojo/templates/dojo/forgot_username.html b/dojo/templates/login/forgot_username.html similarity index 100% rename from dojo/templates/dojo/forgot_username.html rename to dojo/templates/login/forgot_username.html diff --git a/dojo/templates/notifications/mail/forgot_username.tpl b/dojo/templates/login/forgot_username.tpl similarity index 100% rename from dojo/templates/notifications/mail/forgot_username.tpl rename to dojo/templates/login/forgot_username.tpl diff --git a/dojo/templates/dojo/forgot_username_done.html b/dojo/templates/login/forgot_username_done.html similarity index 100% rename from dojo/templates/dojo/forgot_username_done.html rename to dojo/templates/login/forgot_username_done.html diff --git a/dojo/templates/dojo/forgot_username_subject.html b/dojo/templates/login/forgot_username_subject.html similarity index 100% rename from dojo/templates/dojo/forgot_username_subject.html rename to dojo/templates/login/forgot_username_subject.html diff --git a/dojo/templates/dojo/password_reset.html b/dojo/templates/login/password_reset.html similarity index 100% rename from dojo/templates/dojo/password_reset.html rename to dojo/templates/login/password_reset.html diff --git a/dojo/templates/dojo/password_reset_complete.html b/dojo/templates/login/password_reset_complete.html similarity index 100% rename from dojo/templates/dojo/password_reset_complete.html rename to dojo/templates/login/password_reset_complete.html diff --git a/dojo/templates/dojo/password_reset_confirm.html b/dojo/templates/login/password_reset_confirm.html similarity index 100% rename from dojo/templates/dojo/password_reset_confirm.html rename to dojo/templates/login/password_reset_confirm.html diff --git a/dojo/templates/dojo/password_reset_done.html b/dojo/templates/login/password_reset_done.html similarity index 100% rename from dojo/templates/dojo/password_reset_done.html rename to dojo/templates/login/password_reset_done.html diff --git a/dojo/user/urls.py b/dojo/user/urls.py index 22fb861e22..adf3dd80cb 100644 --- a/dojo/user/urls.py +++ b/dojo/user/urls.py @@ -30,26 +30,26 @@ if settings.FORGOT_PASSWORD: urlpatterns.extend([ re_path(r'^password_reset/$', views.DojoPasswordResetView.as_view( - template_name='dojo/password_reset.html', + template_name='login/password_reset.html', ), name="password_reset"), re_path(r'^password_reset/done/$', auth_views.PasswordResetDoneView.as_view( - template_name='dojo/password_reset_done.html', + template_name='login/password_reset_done.html', ), name='password_reset_done'), re_path(r'^reset/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,40})/$', auth_views.PasswordResetConfirmView.as_view( - template_name='dojo/password_reset_confirm.html', + template_name='login/password_reset_confirm.html', ), name='password_reset_confirm'), re_path(r'^reset/done/$', auth_views.PasswordResetCompleteView.as_view( - template_name='dojo/password_reset_complete.html', + template_name='login/password_reset_complete.html', ), name='password_reset_complete'), ]) if settings.FORGOT_USERNAME: urlpatterns.extend([ re_path(r'^forgot_username_done/$', auth_views.PasswordResetDoneView.as_view( - template_name='dojo/forgot_username_done.html', + template_name='login/forgot_username_done.html', ), name="forgot_username_done"), re_path(r'^forgot_username/$', views.DojoForgotUsernameView.as_view( - template_name='dojo/forgot_username.html', + template_name='login/forgot_username.html', success_url=reverse_lazy("forgot_username_done") ), name="forgot_username"), ]) diff --git a/dojo/user/views.py b/dojo/user/views.py index c971d932c1..ea60c93fc1 100644 --- a/dojo/user/views.py +++ b/dojo/user/views.py @@ -612,8 +612,8 @@ def send_mail(self, subject_template_name, email_template_name, from_email = get_system_setting('email_from') url = hyperlink.parse(settings.SITE_URL) - subject_template_name = 'dojo/forgot_username_subject.html' - email_template_name = 'notifications/mail/forgot_username.tpl' + subject_template_name = 'login/forgot_username_subject.html' + email_template_name = 'login/forgot_username.tpl' context['site_name'] = url.host context['protocol'] = url.scheme context['domain'] = settings.SITE_URL[len(f'{url.scheme}://'):] @@ -638,7 +638,7 @@ def send_mail(self, subject_template_name, email_template_name, from_email = get_system_setting('email_from') url = hyperlink.parse(settings.SITE_URL) - email_template_name = 'notifications/mail/forgot_password.tpl' + email_template_name = 'login/forgot_password.tpl' context['site_name'] = url.host context['protocol'] = url.scheme context['domain'] = settings.SITE_URL[len(f'{url.scheme}://'):]