diff --git a/VERSION b/VERSION index 267b104b..adca1046 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.2 (2012-08-30 14:54:37) stable +Version 2.0.2 (2012-08-30 15:01:19) stable diff --git a/gluon/tools.py b/gluon/tools.py index 69894bbf..ecbc37e2 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -1060,6 +1060,7 @@ class Auth(object): request = current.request session = current.session auth = session.auth + self.use_username = None # None means postpone detection self.user_groups = auth and auth.user_groups or {} if auth and auth.last_visit and auth.last_visit + \ datetime.timedelta(days=0, seconds=auth.expiration) > request.now: @@ -1257,6 +1258,9 @@ class Auth(object): if not 'register' in self.settings.actions_disabled: bar.insert(-1, s2) bar.insert(-1, register) + if self.use_username is None: + # should always be false if auth.define_tables() is called + self.use_username = 'username' in self.table_user().fields if self.use_username and \ not 'retrieve_username' in self.settings.actions_disabled: bar.insert(-1, s2)