Move the request.app stuff to the same area

This commit is contained in:
Christopher Allan Webber 2011-04-17 16:36:01 -05:00
parent 582c4d5fb2
commit 0dd6594596

View File

@ -82,14 +82,16 @@ class MediaGoblinApp(object):
## Attach utilities to the request object
request.matchdict = route_match
request.app = self
request.template_env = self.template_env
request.urlgen = routes.URLGenerator(self.routing, environ)
request.db = self.db
request.staticdirect = self.staticdirector
# Do we really want to load this via middleware? Maybe?
request.session = request.environ['beaker.session']
util.setup_user_in_request(request)
# Attach self as request.app
# Also attach a few utilities from request.app for convenience?
request.app = self
request.template_env = self.template_env
request.db = self.db
request.staticdirect = self.staticdirector
return controller(request)(environ, start_response)