[Cubicweb] cw shell and user sessions
aurelien.campeas at logilab.fr
Tue Jul 31 16:17:40 CEST 2012
Le 31/07/2012 16:11, Stéphane Bugat a écrit :
> Aurélien, as unbelievable as it is, it works! Just needed to use ``s = session.hijack(user)`` instead of the ``with`` statement, because session does not have an __exit__() method.
Well, it's not that unbelievable to me since I'm an avid user of
> A priori a simple s.close() is sufficient to go back to the admin session.
> I really like this 'untested' workaround - although it sounds a bit violent ;-)
The name was probably chosen to warn its potential users, but there is
actually little involved violence ;-)
> ----- Mail original -----
>> De: "Aurélien Campéas"<aurelien.campeas at logilab.fr>
>> À: "Stéphane Bugat"<stephane.bugat at free.fr>
>> Cc: cubicweb at lists.cubicweb.org
>> Envoyé: Mardi 31 Juillet 2012 15:50:11
>> Objet: Re: [Cubicweb] cw shell and user sessions
>> Le 31/07/2012 15:36, Stéphane Bugat a écrit :
>>> Sorry for this hailstorm of questions, but you probably know that
>>> the summer is really a suitable time for development.
>>> So just a simple question: when using a cw shell session, is it
>>> possible to reconnect using another user login? I know it is
>>> possible in unitests, using the self.login() method of CubicWebTC,
>>> but it doesn't seem to be available in a shell session.
>>> Thanks in advance
>> You may want to try;
>> with session.hijack_user(someuser) as s:
More information about the Cubicweb