Traceback (most recent call last): File "H:\...\web2py\gluon\restricted.py", line 209, in restricted
exec ccode in environment File "H:/.../web2py/applications/secure/controllers/default.py" <http://127.0.0.1:8000/admin/default/edit/secure/controllers/default.py>, line 3988, in <module> File "H:\...\web2py\gluon\globals.py", line 182, in <lambda> self._caller = lambda f: f() File "H:/.../web2py/applications/secure/controllers/default.py" <http://127.0.0.1:8000/admin/default/edit/secure/controllers/default.py>, line 1932, in impersonateEnd auth.impersonate(0) File "H:\...\web2py\gluon\tools.py", line 2756, in impersonate return SQLFORM(table_user, user.id, readonly=True) UnboundLocalError: local variable 'user' referenced before assignment 2012/10/16 Massimo Di Pierro <massimo.dipie...@gmail.com> > can you show all traceback? > > > On Tuesday, 16 October 2012 07:18:38 UTC-5, mweissen wrote: > >> Is this the actual trunc-version? >> Version 2.1.1 (2012-10-16 06:19:35) dev >> >> >> I get the same message >> <type 'exceptions.UnboundLocalError'**> local variable 'user' referenced >> before assignment >> 2012/10/16 Massimo Di Pierro <massimo....@gmail.com> >> >> There is a bug, I just fixed it in trunk. >>> >>> auth.impersonate(0) >>> is correct. >>> >>> >>> On Tuesday, 16 October 2012 04:38:35 UTC-5, mweissen wrote: >>>> >>>> I have called >>>> auth.impersonate(0) >>>> to finish impersonation. >>>> >>>> Now (Version 2.1.1) I see: >>>> >>>> >>>> Traceback (most recent call last): >>>> File "H:\...\web2py\gluon\**restricte**d.py", line 209, in restricted >>>> >>>> >>>> >>>> >>>> >>>> >>>> exec ccode in environment >>>> File "H:/.../applications/secure/**co**ntrollers/default.py" >>>> <http://127.0.0.1:8000/admin/default/edit/secure/controllers/default.py>, >>>> line 3988, in <module> >>>> >>>> >>>> >>>> >>>> >>>> >>>> File "H:\...\web2py\gluon\globals.**p**y", line 187, in <lambda> >>>> >>>> >>>> >>>> >>>> >>>> >>>> self._caller = lambda f: f() >>>> >>>> >>>> >>>> >>>> >>>> >>>> File "H:/.../applications/secure/**co**ntrollers/default.py" >>>> <http://127.0.0.1:8000/admin/default/edit/secure/controllers/default.py>, >>>> line 1932, in impersonateEnd >>>> >>>> >>>> >>>> >>>> >>>> >>>> auth.impersonate(0) >>>> File "H:\...\web2py\gluon\tools.py"****, line 2755, in impersonate >>>> >>>> >>>> >>>> >>>> >>>> >>>> return SQLFORM(table_user, user.id, readonly=True) >>>> >>>> >>>> >>>> >>>> >>>> UnboundLocalError: local variable 'user' referenced before assignment >>>> >>>> >>>> My function: >>>> def impersonateEnd(): >>>> auth.impersonate(0) >>>> redirect(URL('index',vars=**dict**(flash=T('End of >>>> impersonation')))) >>>> >>>> What ist the best way to end impersonation? >>>> >>>> Regards, Martin >>>> >>> >>> --