diff --git a/.gitignore b/.gitignore index 561cbd56e2..91be399853 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ pep8.txt *.db *.tmp virtualenv +.venv .DS_Store *.prefs diff --git a/allauth/account/urls.py b/allauth/account/urls.py index 8bea3c901a..e64b839a0f 100644 --- a/allauth/account/urls.py +++ b/allauth/account/urls.py @@ -13,6 +13,11 @@ views.password_change, name="account_change_password", ), + path( + "password/change/done/", + views.password_change_done, + name="account_change_password_done", + ), path("password/set/", views.password_set, name="account_set_password"), path("inactive/", views.account_inactive, name="account_inactive"), # Email diff --git a/allauth/account/views.py b/allauth/account/views.py index d2ab9163b5..5162b8782b 100644 --- a/allauth/account/views.py +++ b/allauth/account/views.py @@ -614,11 +614,18 @@ def get_ajax_data(self): email = login_required(EmailView.as_view()) +class PasswordChangeDone(TemplateView): + template_name = "account/password_change_done." + app_settings.TEMPLATE_EXTENSION + + +password_change_done = login_required(PasswordChangeDone.as_view()) + + @method_decorator(rate_limit(action="change_password"), name="dispatch") class PasswordChangeView(AjaxCapableProcessFormViewMixin, FormView): template_name = "account/password_change." + app_settings.TEMPLATE_EXTENSION form_class = ChangePasswordForm - success_url = reverse_lazy("account_change_password") + success_url = reverse_lazy("account_change_password_done") def get_form_class(self): return get_form_class(app_settings.FORMS, "change_password", self.form_class) diff --git a/allauth/mfa/migrations/0001_initial.py b/allauth/mfa/migrations/0001_initial.py index bbe4a9f8b4..97a7f63fe6 100644 --- a/allauth/mfa/migrations/0001_initial.py +++ b/allauth/mfa/migrations/0001_initial.py @@ -1,8 +1,8 @@ # Generated by Django 3.2.20 on 2023-08-19 14:43 +import django.db.models.deletion from django.conf import settings from django.db import migrations, models -import django.db.models.deletion class Migration(migrations.Migration): diff --git a/allauth/socialaccount/migrations/0005_socialtoken_nullable_app.py b/allauth/socialaccount/migrations/0005_socialtoken_nullable_app.py index aed1d3ba35..eec48cb8b2 100644 --- a/allauth/socialaccount/migrations/0005_socialtoken_nullable_app.py +++ b/allauth/socialaccount/migrations/0005_socialtoken_nullable_app.py @@ -1,7 +1,7 @@ # Generated by Django 3.2.20 on 2023-09-03 19:46 -from django.db import migrations, models import django.db.models.deletion +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/allauth/templates/account/password_change_done.html b/allauth/templates/account/password_change_done.html new file mode 100644 index 0000000000..bec12a45ec --- /dev/null +++ b/allauth/templates/account/password_change_done.html @@ -0,0 +1,9 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans password changed %}t {% endblock %} + +{% block content %} +

{% trans password successfully changed %}

+{% endblock %} diff --git a/test_settings.py b/test_settings.py index 6ba55bd142..e27b901c82 100644 --- a/test_settings.py +++ b/test_settings.py @@ -48,7 +48,6 @@ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", - "allauth.account.middleware.AccountMiddleware", )