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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.