From ce2e6ea45fff807bf761846d1d8b5da27a8e0793 Mon Sep 17 00:00:00 2001 From: Alexandra Bruckner Date: Wed, 20 Sep 2023 08:38:18 +0200 Subject: [PATCH] Add Django 4.2 support --- password_reset/forms.py | 2 +- password_reset/signals.py | 5 ++--- password_reset/urls.py | 10 +++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/password_reset/forms.py b/password_reset/forms.py index 8dc0ad1d..bfc9387f 100644 --- a/password_reset/forms.py +++ b/password_reset/forms.py @@ -2,7 +2,7 @@ from django.contrib.auth import get_user_model from django.core.validators import validate_email from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.conf import settings diff --git a/password_reset/signals.py b/password_reset/signals.py index 6bf3823f..acce92da 100644 --- a/password_reset/signals.py +++ b/password_reset/signals.py @@ -1,6 +1,5 @@ from django.dispatch import Signal # signal sent when users successfully recover their passwords -user_recovers_password = Signal( - providing_args=['user', 'request'] -) +# args=['user', 'request'] +user_recovers_password = Signal() diff --git a/password_reset/urls.py b/password_reset/urls.py index eedad198..6b2e22c5 100644 --- a/password_reset/urls.py +++ b/password_reset/urls.py @@ -1,13 +1,13 @@ -from django.conf.urls import url +from django.urls import path from . import views urlpatterns = [ - url(r'^recover/(?P.+)/$', views.recover_done, + path('recover//', views.recover_done, name='password_reset_sent'), - url(r'^recover/$', views.recover, name='password_reset_recover'), - url(r'^reset/done/$', views.reset_done, name='password_reset_done'), - url(r'^reset/(?P[\w:-]+)/$', views.reset, + path('recover/', views.recover, name='password_reset_recover'), + path('reset/done/', views.reset_done, name='password_reset_done'), + path('reset//', views.reset, name='password_reset_reset'), ]