From 8ca369ae2cfeaa4e2c77b96688e5649f84dc5a53 Mon Sep 17 00:00:00 2001 From: ifac0 Date: Thu, 6 Oct 2016 23:16:48 -0300 Subject: [PATCH] atualização de urls para remember password #58 --- core/templates/registration/passwor_reset_email.html | 2 +- core/templates/registration/password_reset_subject.txt | 3 +++ core/urls.py | 16 ++++++++++------ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 core/templates/registration/password_reset_subject.txt diff --git a/core/templates/registration/passwor_reset_email.html b/core/templates/registration/passwor_reset_email.html index 65c725b..ca9e5bd 100644 --- a/core/templates/registration/passwor_reset_email.html +++ b/core/templates/registration/passwor_reset_email.html @@ -2,7 +2,7 @@ To initiate the password reset process for your {{ user.get_username }} TestSite click the link below: {% block reset_link %} -{{ protocol }}://{{ domain }}{% url 'core:passwor_reset_confirm' uidb36=uid token=token %} +{{ protocol }}://{{ domain }}{% url 'core:password_reset_confirm' uidb64=uid token=token %} {% endblock %} diff --git a/core/templates/registration/password_reset_subject.txt b/core/templates/registration/password_reset_subject.txt new file mode 100644 index 0000000..36292d6 --- /dev/null +++ b/core/templates/registration/password_reset_subject.txt @@ -0,0 +1,3 @@ +{% load i18n %}{% autoescape off %} +{% blocktrans %}Password reset on {{ site_name }}{% endblocktrans %} +{% endautoescape %} diff --git a/core/urls.py b/core/urls.py index c3c530e..7b1f65b 100644 --- a/core/urls.py +++ b/core/urls.py @@ -11,13 +11,17 @@ urlpatterns = [ url(r'^logout/$', auth_views.logout, {'next_page': 'core:home'}, name='logout'), url(r'^notification/([0-9]+)/$', views.processNotification, name='notification_read'), url(r'^getNotifications/$', views.getNotifications, name='getNotifications'), -] #Reset Password -urlpatterns += [ - url(r'^password/reset/$', password_reset, {'post_reset_redirect' : 'password/reset/done/','template_name': 'registration/passwor_reset_form.html'}, name="password_reset"), - url(r'^password/reset/done/$', password_reset_done, {'template_name': 'registration/passwor_reset_done.html'}), - url(r'^password/reset/(?P[0-9A-Za-z]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', password_reset_confirm, {'post_reset_redirect' : 'password/done/', 'template_name': 'registration/password_reset_confirm.html'}), - url(r'^password/done/$', password_reset_complete,{'template_name': 'registration/passwor_reset_complete.html'}), + url(r'^reset/$', password_reset, {'template_name':'registration/passwor_reset_form.html', + 'email_template_name':'registration/passwor_reset_email.html', + 'subject_template_name' :'registration/password_reset_subject.txt', + 'post_reset_redirect':'done/'}, name="password_reset"), + url(r'^reset/done/$', password_reset_done, {'template_name':'registration/passwor_reset_done.html'}), + url(r'^reset/(?P[0-9A-Za-z]+)/(?P.+)/$', password_reset_confirm, + {'template_name':'registration/passwor_reset_confirm.html', + 'post_reset_redirect' : 'done/'}, + name='password_reset_confirm'), + url(r'^done/$', password_reset_complete,{'template_name':'registration/passwor_reset_complete.html'}), ] -- libgit2 0.21.2