From 9e8ef3585e803fe259bc781d046dced7adba3309 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 9 Mar 2014 08:55:22 -0500 Subject: [PATCH] fixed problem with login bare when registration_key is None --- VERSION | 2 +- gluon/tools.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 51b111ae..8347cfaa 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.9.4-stable+timestamp.2014.03.08.14.39.02 +Version 2.9.4-stable+timestamp.2014.03.09.08.54.17 diff --git a/gluon/tools.py b/gluon/tools.py index 8e592fc4..98675cfe 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -2062,8 +2062,9 @@ class Auth(object): if user and user.get(settings.passfield, False): password = settings.table_user[ settings.passfield].validate(password)[0] - if not user.registration_key.strip() and password == \ - user[settings.passfield]: + if ((user.registration_key is None or + not user.registration_key.strip()) and + password == user[settings.passfield]): self.login_user(user) return user else: @@ -2349,8 +2350,8 @@ class Auth(object): elif temp_user.registration_key in ('disabled', 'blocked'): response.flash = self.messages.login_disabled return form - elif not temp_user.registration_key is None and \ - temp_user.registration_key.strip(): + elif (not temp_user.registration_key is None + and temp_user.registration_key.strip()): response.flash = \ self.messages.registration_verifying return form