[FIX] http.WebRequest: clear db/uid tracking on worker thread to avoid incorrect values during logging
Could happen when a worker thread is reused for another database but does not go through all the dispatching levels, e.g. for static resources served by werkzeug itself. bzr revid: odo@openerp.com-20130228173530-bs5pun9o09iobosi
This commit is contained in:
@@ -93,6 +93,14 @@ class WebRequest(object):
|
||||
if not self.session:
|
||||
self.session = session.OpenERPSession()
|
||||
self.httpsession[self.session_id] = self.session
|
||||
|
||||
# set db/uid trackers - they're cleaned up at the end of the
|
||||
# WSGI dispatching phase in openerp.service.wsgi_server.application
|
||||
if self.session._db:
|
||||
threading.current_thread().dbname = self.session._db
|
||||
if self.session._uid:
|
||||
threading.current_thread().uid = self.session._uid
|
||||
|
||||
self.context = self.params.pop('context', {})
|
||||
self.debug = self.params.pop('debug', False) is not False
|
||||
# Determine self.lang
|
||||
|
||||
Reference in New Issue
Block a user