you can also do: logged_in = 'auth' in globals() and auth.user
On Dec 15, 11:12 am, Martín Mulone <mulone.mar...@gmail.com> wrote: > This is my method: > > def is_user_logged_in(): > logged_in=False > if 'auth' in globals(): > if auth.is_logged_in(): > logged_in=True > > return logged_in > > 2010/12/15 Adi <aditya.sa...@gmail.com>: > > > > > Hi, > > I'm trying to set up a function for authenticating users over a service. > > This is my method: > > def authenticate(): > > > is_loggedin = auth and auth.user > > > if not is_loggedin: > > > auth.allow_basic_login = True > > > is_loggedin = auth.basic() > > > return is_loggedin > > > This is how I call it: curl -u a%40b.com:test > >http://127.0.0.1:8000/app/default/authenticate > > > a...@b.com is the username, test is the password. This is returning False > > when > > I expected True. What am I missing? > > -- > My blog: http://martin.tecnodoc.com.ar > My portfolio *spanish*: http://www.tecnodoc.com.ar > Checkout my last proyect instant-press:http://www.instant2press.com