[FIX] core: exception are made to be raised
This commit is contained in:
parent
08ed48e24c
commit
ee846fbff8
|
@ -211,7 +211,7 @@ class WebRequest(object):
|
||||||
to a database.
|
to a database.
|
||||||
"""
|
"""
|
||||||
if not self.db:
|
if not self.db:
|
||||||
return RuntimeError('request not bound to a database')
|
raise RuntimeError('request not bound to a database')
|
||||||
return openerp.api.Environment(self.cr, self.uid, self.context)
|
return openerp.api.Environment(self.cr, self.uid, self.context)
|
||||||
|
|
||||||
@lazy_property
|
@lazy_property
|
||||||
|
@ -247,7 +247,7 @@ class WebRequest(object):
|
||||||
# can not be a lazy_property because manual rollback in _call_function
|
# can not be a lazy_property because manual rollback in _call_function
|
||||||
# if already set (?)
|
# if already set (?)
|
||||||
if not self.db:
|
if not self.db:
|
||||||
return RuntimeError('request not bound to a database')
|
raise RuntimeError('request not bound to a database')
|
||||||
if not self._cr:
|
if not self._cr:
|
||||||
self._cr = self.registry.cursor()
|
self._cr = self.registry.cursor()
|
||||||
return self._cr
|
return self._cr
|
||||||
|
|
Loading…
Reference in New Issue