Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

password_change_done #3428

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pep8.txt
*.db
*.tmp
virtualenv
.venv
.DS_Store

*.prefs
Expand Down
5 changes: 5 additions & 0 deletions allauth/account/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion allauth/account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion allauth/mfa/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
9 changes: 9 additions & 0 deletions allauth/templates/account/password_change_done.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}{% trans password changed %}t {% endblock %}

{% block content %}
<p>{% trans password successfully changed %}</p>
{% endblock %}
1 change: 0 additions & 1 deletion test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",

"allauth.account.middleware.AccountMiddleware",
)

Expand Down