From 09ae2df4eb6b7384403beb323d757fd0f6a81eba Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Thu, 23 May 2013 13:20:13 -0700 Subject: [PATCH] modified basic_auth.check_login to check that the user has a pw_hash first --- mediagoblin/plugins/basic_auth/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mediagoblin/plugins/basic_auth/__init__.py b/mediagoblin/plugins/basic_auth/__init__.py index 74d6b836..d0545627 100644 --- a/mediagoblin/plugins/basic_auth/__init__.py +++ b/mediagoblin/plugins/basic_auth/__init__.py @@ -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 -- 2.25.1