diff options
| author | Paul Morelle <pmo@odoo.com> | 2020-06-24 11:49:58 +0000 |
|---|---|---|
| committer | Paul Morelle <pmo@odoo.com> | 2020-06-24 16:06:11 +0000 |
| commit | f463983cf9743c57e5f39fa04cc02a2a8c9a58a4 (patch) | |
| tree | ab81a4db21787284328b8a0e5d6929d886f453c5 | |
| parent | 5e888f8a6ccf9996b3231db6bf314d045619109e (diff) | |
[FIX] website: fix semantics of MockRequest
We should push the request object on the request stack only in the
__enter__ method, in order to be symmetrical with the __exit__ method.
closes odoo/odoo#53613
X-original-commit: 30e94d305f9cffa816ddc213e0b9329c0263c145
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
| -rw-r--r-- | addons/website/tools.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website/tools.py b/addons/website/tools.py index 7182ee67e8a..44530e3ce52 100644 --- a/addons/website/tools.py +++ b/addons/website/tools.py @@ -116,9 +116,9 @@ class MockRequest(object): }, 'website': kw.get('website'), }) - odoo.http._request_stack.push(self.request) def __enter__(self): + odoo.http._request_stack.push(self.request) return self.request def __exit__(self, exc_type, exc_value, traceback): |
