summaryrefslogtreecommitdiff
path: root/odoo/http.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-06-13 14:12:12 +0200
committerChristophe Simonis <chs@odoo.com>2018-06-13 14:12:12 +0200
commitbdd051bf78254ca9e3b72f8530c1ecf505040cab (patch)
tree2d900b1363214e900d43d6b2bbc771ec58cf4607 /odoo/http.py
parentd44cd778844c18d5af1f631648b38321f26cb579 (diff)
parentc43c54017259fb756f5449abf115c514b49ed371 (diff)
[MERGE] forward port branch saas-14 up to c43c5401725
Diffstat (limited to 'odoo/http.py')
-rw-r--r--odoo/http.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/odoo/http.py b/odoo/http.py
index 84298c20a63..0075b1bed34 100644
--- a/odoo/http.py
+++ b/odoo/http.py
@@ -1047,7 +1047,7 @@ class OpenERPSession(werkzeug.contrib.sessions.Session):
self.db = db
self.uid = uid
self.login = login
- self.session_token = uid and security.compute_session_token(self)
+ self.session_token = uid and security.compute_session_token(self, request.env)
request.uid = uid
request.disable_db = False
@@ -1062,15 +1062,17 @@ class OpenERPSession(werkzeug.contrib.sessions.Session):
"""
if not self.db or not self.uid:
raise SessionExpiredException("Session expired")
-
+ # We create our own environment instead of the request's one.
+ # to avoid creating it without the uid since request.uid isn't set yet
+ env = odoo.api.Environment(request.cr, self.uid, self.context)
# == BACKWARD COMPATIBILITY TO CONVERT OLD SESSION TYPE TO THE NEW ONES ! REMOVE ME AFTER 11.0 ==
if self.get('password'):
security.check(self.db, self.uid, self.password)
- self.session_token = security.compute_session_token(self)
+ self.session_token = security.compute_session_token(self, env)
self.pop('password')
# =================================================================================================
# here we check if the session is still valid
- if not security.check_session(self):
+ if not security.check_session(self, env):
raise SessionExpiredException("Session expired")
def logout(self, keep_db=False):