diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-06-15 10:15:27 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-06-15 10:15:27 +0200 |
| commit | b170a753e18c96f59e8c99a4e1750a4b85628338 (patch) | |
| tree | 13c365d5e3db51e3b94def4e88968170743ce7ae /odoo/http.py | |
| parent | a3c9c286cc46e03040e954f7872ade3555d98ad9 (diff) | |
| parent | b05e4d5f958892a9ff644b28a4ee165aeb2ea247 (diff) | |
[MERGE] forward port branch 11.0 up to b05e4d5f958
Diffstat (limited to 'odoo/http.py')
| -rw-r--r-- | odoo/http.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/odoo/http.py b/odoo/http.py index f984bcb44df..09999066941 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1038,7 +1038,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 @@ -1053,9 +1053,11 @@ 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) # 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): |
