summaryrefslogtreecommitdiff
path: root/odoo/http.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-08-08 19:14:05 +0200
committerChristophe Simonis <chs@odoo.com>2017-08-08 19:14:05 +0200
commit40a82cdfda5e17b5712da46c412a75e0bd7883c3 (patch)
treec969d557135dbf7c5367be4f80473808b99dbdec /odoo/http.py
parente1b954f066a42fd9eb613861a517070f8ad35823 (diff)
[FIX] http: ensure registry is still bound to the request before using it
A user can be logged out during a request, loosing the database (and thus registry) information.
Diffstat (limited to 'odoo/http.py')
-rw-r--r--odoo/http.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/odoo/http.py b/odoo/http.py
index 338ebb30099..626f43bbea4 100644
--- a/odoo/http.py
+++ b/odoo/http.py
@@ -280,8 +280,9 @@ class WebRequest(object):
if self._cr:
if exc_type is None and not self._failed:
self._cr.commit()
- self.registry.signal_changes()
- else:
+ if self.registry:
+ self.registry.signal_changes()
+ elif self.registry:
self.registry.reset_changes()
self._cr.close()
# just to be sure no one tries to re-use the request