Switch authenticator to migrate back to Django style passwords

This commit is contained in:
2011-05-16 12:00:35 +01:00
parent 08cbd72045
commit 43a672574d

View File

@@ -17,11 +17,10 @@ class SimpleHashModelBackend(ModelBackend):
if '$' in user.password:
if user.check_password(password):
user.password = sha1(password).hexdigest()
user.save()
return user
else:
if user.password == sha1(password).hexdigest():
user.set_password(password)
return user
return None