diff --git a/VERSION b/VERSION index ab5528da..e1c65f4e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.2 (2012-08-30 08:17:25) stable +Version 2.0.2 (2012-08-30 08:31:49) stable diff --git a/gluon/tools.py b/gluon/tools.py index 58ab9617..69894bbf 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -1612,12 +1612,12 @@ class Auth(object): checks = [] # make a guess about who this user is for fieldname in ['registration_id','username','email']: - if fieldname in table_user.fields() and keys.get(fieldname,None): + if fieldname in table_user.fields() and \ + keys.get(fieldname,None): checks.append(fieldname) value = keys[fieldname] - user = user or table_user._db( - (table_user.registration_id==value)| - (table_user[fieldname]==value)).select().first() + user = table_user(**{fieldname:value}) + if user: break if not checks: return None if not 'registration_id' in keys: