[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:
+3
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user