I don't think you can be sure you have logged user except by using
comet_messenger.py contrib and tornado. There is many thread about this.

Richard


On Wed, Sep 25, 2013 at 9:04 AM, ajith c t <[email protected]> wrote:

> Hi,
>
>     I have a scheduler which is setup in a model file. A set of task is
> written in the scheduler.py which is queued from the controller. My problem
> is I need to get the current logged in user in this scheduler.py file so
> that I can write query with respect to the logged in user.
>
> I can obtain the current logged in user using the command auth.user in the
> scheduler.py file. But when I call auth.user from a task defined in the
> same scheduler.py , file it returns none.
>
> scheduler.py file
>
> print auth.user
>
> def task1():
>       logger.debug("current user: %s, auth.user)
>       return
>
>
> the output in the first case is row of the  logged in user  while none in
> second case.
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to