Ignore:
Timestamp:
Aug 9, 2009, 6:45:28 PM (15 years ago)
Author:
quentin
Message:

Initialize state object correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy/code/view.py

    r2397 r2399  
    77import datetime, decimal
    88from invirt.config import structs as config
     9from webcommon import State
    910
    1011class MakoHandler(cherrypy.dispatch.LateParamPageHandler):
     
    100101cherrypy.tools.remote_user_login = cherrypy.Tool('on_start_resource', remote_user_login, priority=50)
    101102
     103def invirtwebstate_init():
     104    """Initialize the cherrypy.request.state object from Invirt"""
     105    cherrypy.request.state = State(cherrypy.request.login)
     106
     107cherrypy.tools.invirtwebstate = cherrypy.Tool('on_start_resource', invirtwebstate_init, priority=100)
     108
    102109class View(object):
    103110    _cp_config = {'tools.mako.directories': [os.path.join(os.path.dirname(__file__),'templates')]}
Note: See TracChangeset for help on using the changeset viewer.