modified basic_auth.check_login to check that the user has a pw_hash first
authorRodney Ewing <ewing.rj@gmail.com>
Thu, 23 May 2013 20:20:13 +0000 (13:20 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Fri, 24 May 2013 23:52:49 +0000 (16:52 -0700)
mediagoblin/plugins/basic_auth/__init__.py

index 74d6b8360f27c5b4ac79b8a9468b683e7f804d8c..d05456277ab23c35ed8b934b49ad7e082d9dd994 100644 (file)
@@ -28,9 +28,10 @@ def setup_plugin():
 
 
 def check_login(user, password):
-    result = auth_lib.bcrypt_check_password(password, user.pw_hash)
-    if result:
-        return result
+    if user.pw_hash:
+        result = auth_lib.bcrypt_check_password(password, user.pw_hash)
+        if result:
+            return result
     return None