[FIX] LazyResponse exceptions not properly managed in auth="none"

bzr revid: fme@openerp.com-20140116135650-c3gri2m1j80wcwca
This commit is contained in:
Fabien Meghazi 2014-01-16 14:56:50 +01:00
parent cee6749395
commit 2e43125353
1 changed files with 6 additions and 1 deletions

View File

@ -939,7 +939,12 @@ class Root(object):
try:
result.process()
except(Exception), e:
result = request.registry['ir.http']._handle_exception(e)
# In case of auth="none" we re-activate db getter for exception handling
request.disable_db = False
if request.db:
result = request.registry['ir.http']._handle_exception(e)
else:
raise
if isinstance(result, basestring):
response = werkzeug.wrappers.Response(result, mimetype='text/html')