diff --git a/admin/models.py b/admin/models.py index bf3e764ef..79b7aed65 100644 --- a/admin/models.py +++ b/admin/models.py @@ -302,7 +302,7 @@ class Mailbox(DatesAware): :param value: the new password's value """ if parameters.get_admin("AUTHENTICATION_TYPE") == "local": - self.password = crypt_password(value) + self.password = crypt_password(newvalue) self.save() return diff --git a/admin/tests.py b/admin/tests.py index c8934b8ab..45ba6f0ed 100644 --- a/admin/tests.py +++ b/admin/tests.py @@ -79,7 +79,7 @@ class MailboxTestCase(TestCase): Two cases: * The default admin changes his password (no associated Mailbox) - * A normal user changes hist password + * A normal user changes his password """ clt = Client() self.assertEqual(clt.login(username="admin", password="toto"), True) diff --git a/userprefs/views.py b/userprefs/views.py index 7a23cf883..7d620d44a 100644 --- a/userprefs/views.py +++ b/userprefs/views.py @@ -40,6 +40,7 @@ def changepassword(request, tplname="userprefs/chpassword.html"): request.session["password"] = encrypt(request.POST["confirmation"]) else: target.set_password(request.POST["confirmation"]) + target.save() if error is None: return ajax_response(request, respmsg=_("Password changed"))