Changing local passwords was not working anymore :p

see #192
This commit is contained in:
Antoine Nguyen
2012-01-10 11:04:03 +01:00
parent ba0ed344c5
commit 7eee4c1284
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)
+1
View File
@@ -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"))