Use API function instead of UNUSABLE_PASSWORD
authorAlex Dehnert <adehnert@mit.edu>
Mon, 24 Dec 2012 08:39:49 +0000 (03:39 -0500)
committerMIT Association of Student Activities <asa@mit.edu>
Mon, 24 Dec 2012 08:39:49 +0000 (03:39 -0500)
Yay abstractions, or something.

__init__.py

index dc3fefa36ca5b2c0e28cf07b59b7b98062ebced1..73e7e88d4978a4933a071432dcb0c55b73d939cc 100644 (file)
@@ -5,7 +5,6 @@ import ldap
 import ldap.filter
 
 from django.contrib.auth.backends import RemoteUserBackend
-from django.contrib.auth.hashers import UNUSABLE_PASSWORD
 from django.contrib.auth.middleware import RemoteUserMiddleware
 from django.contrib.auth.views import login
 from django.contrib.auth import REDIRECT_FIELD_NAME
@@ -83,7 +82,7 @@ class ScriptsRemoteUserBackend(RemoteUserBackend):
             return username
     def configure_user(self, user, ):
         username = user.username
-        user.password = UNUSABLE_PASSWORD
+        user.set_unusable_password()
         con = ldap.open('ldap-too.mit.edu')
         con.simple_bind_s("", "")
         dn = "dc=mit,dc=edu"