[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.
This commit is contained in:
Christophe Simonis
2017-08-08 19:14:05 +02:00
parent e1b954f066
commit 40a82cdfda
+3 -2
View File
@@ -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