diff --git a/gluon/tools.py b/gluon/tools.py index 131b7a8e..0dbecb1e 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -2112,7 +2112,7 @@ class Auth(object): success = False if row: userfield = self.settings.login_userfield or 'username' \ - if 'username' in table_user.fields else 'email' + if 'username' in table.fields else 'email' # If ticket is a service Ticket and RENEW flag respected if ticket[0:3] == 'ST-' and \ not ((row.renew and renew) ^ renew):