X-Git-Url: https://git.mdrn.pl/cas.git/blobdiff_plain/9d910fae000b9c2789c66c0039a6fe5962c04b84..1c1998bd8961dbe721b9e133811678c92fd3c685:/src/accounts/views.py diff --git a/src/accounts/views.py b/src/accounts/views.py index 5f153c0..9a95608 100644 --- a/src/accounts/views.py +++ b/src/accounts/views.py @@ -1,6 +1,7 @@ # Create your views here. from django import http from django.contrib.auth.decorators import login_required +from django.contrib.auth import update_session_auth_hash from django.contrib import messages from django.shortcuts import render from django.utils.translation import ugettext as _ @@ -37,6 +38,7 @@ def account_change_password(request): if form.is_valid(): request.user.set_password(form.cleaned_data['new_password']) request.user.save() + update_session_auth_hash(request, request.user) messages.add_message(request, messages.INFO, _("Password has been changed.")) return http.HttpResponseRedirect('/accounts/')