Skip to content

Commit

Permalink
Merge pull request #150 from PersonalGenomesOrg/fix-change-password-l…
Browse files Browse the repository at this point in the history
…ogout

Fix logout on password change in Django 1.7+
  • Loading branch information
brosner committed Nov 18, 2014
2 parents 5250a73 + 8d43830 commit 4972fa3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ def change_password(self, form):
user = self.request.user
user.set_password(form.cleaned_data["password_new"])
user.save()
# Django >= 1.7 requires this call to stay logged in.
if hasattr(auth, 'update_session_auth_hash'):
auth.update_session_auth_hash(self.request, user)

def after_change_password(self):
user = self.request.user
Expand Down

0 comments on commit 4972fa3

Please sign in to comment.