You're returning an instance of a function instead of the value of the
function.  Change "return handle" to return handle()

On Mon, Sep 24, 2012 at 8:02 AM, Bill Seitz <flux...@gmail.com> wrote:

> I'm trying to stick an application processor in my app to check whether
> the user is logged in. The code is:
>
> def check_authorized(handle):
>     path = web.ctx.path
>     if path in ('/login', '/register'):
>     return handle
>     if not session.has_key('user_id'):
>         web.debug('check_authorized: no session user_id')
>         raise web.seeother('/static/splash.html')
>     return handle
> app.add_processor(check_authorized)
>
> When I hit the "normal" pages I get bounced to the splash page nicely.
>
> But when I hit /login or /register I get a page whose entire contents are:
> <function <lambda> at 0x101bd6578>
>
> What stupid mistake am I making?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/webpy/-/K9DkQ-NkcQ4J.
> To post to this group, send email to webpy@googlegroups.com.
> To unsubscribe from this group, send email to
> webpy+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to webpy@googlegroups.com.
To unsubscribe from this group, send email to 
webpy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to