[IMP] http: bind http.request before calling _get_session_and_dbname() on new request

closes odoo/odoo#104605

X-original-commit: a4a71d34ffa60154f2764e1dfa5b0d688644603c
Signed-off-by: Julien Castiaux <juc@odoo.com>
This commit is contained in:
Nils Hamerlinck
2022-10-31 13:39:53 +01:00
parent 1a4750942a
commit b92082d494
+4 -1
View File
@@ -1107,10 +1107,12 @@ class Request:
self.dispatcher = _dispatchers['http'](self) # until we match
#self.params = {} # set by the Dispatcher
self.session, self.db = self._get_session_and_dbname()
self.registry = None
self.env = None
def _post_init(self):
self.session, self.db = self._get_session_and_dbname()
def _get_session_and_dbname(self):
# The session is explicit when it comes from the query-string or
# the header. It is implicit when it comes from the cookie or
@@ -1951,6 +1953,7 @@ class Application:
werkzeug.datastructures.ImmutableOrderedMultiDict)
request = Request(httprequest)
_request_stack.push(request)
request._post_init()
current_thread.url = httprequest.url
try: