kumidc/frontend/views/password.py

12 lines
471 B
Python
Raw Normal View History

2022-08-04 11:15:10 +00:00
from django.contrib.auth.views import PasswordChangeView as DjangoPasswordChangeView
from django.urls import reverse_lazy
from django.contrib import messages
class PasswordChangeView(DjangoPasswordChangeView):
success_url = reverse_lazy("frontend:dashboard")
template_name = "frontend/change_password.html"
def form_valid(self, form):
messages.success(self.request, "Your password was changed successfully.")
return super().form_valid(form)