From c13b4f18f729b946c052c0c820257538e65a7cca Mon Sep 17 00:00:00 2001 From: Massimo Date: Tue, 16 Oct 2012 11:08:42 -0500 Subject: [PATCH] fixed auth.impersonating again, thanks Ricardo --- VERSION | 2 +- gluon/tools.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index e12e943f..100f8195 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.1.1 (2012-10-16 10:54:30) dev +Version 2.1.1 (2012-10-16 11:08:39) dev diff --git a/gluon/tools.py b/gluon/tools.py index 7f9eb83f..80a1924b 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -2746,10 +2746,11 @@ class Auth(object): callback(form) log = self.messages.impersonate_log self.log_event(log,dict(id=current_id, other_id=auth.user.id)) - elif user_id in (0, '0') and self.is_impersonating(): - session.clear() - session.update(cPickle.loads(auth.impersonator)) - self.user = session.auth.user + elif user_id in (0, '0'): + if self.is_impersonating(): + session.clear() + session.update(cPickle.loads(auth.impersonator)) + self.user = session.auth.user return None if requested_id is DEFAULT and not request.post_vars: return SQLFORM.factory(Field('user_id', 'integer'))