diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-06-13 18:13:48 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-06-13 18:13:48 +0200 |
| commit | d45c32baac722d66af3ae989ff6c3c717cbf3518 (patch) | |
| tree | 582a69ef3bdd35ebe3d60c46ee5c5f37af0e393d /odoo/http.py | |
| parent | ab0b3a6217a8e68ef0f0f4be707d8000553d72f5 (diff) | |
| parent | bdd051bf78254ca9e3b72f8530c1ecf505040cab (diff) | |
[MERGE] forward port branch saas-15 up to bdd051bf782
Diffstat (limited to 'odoo/http.py')
| -rw-r--r-- | odoo/http.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/odoo/http.py b/odoo/http.py index a4acca793bc..5b738486a28 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1039,7 +1039,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 @@ -1054,15 +1054,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): |
