From 2cb77eb10462efe7fd36e5428b56cd0933ae645e Mon Sep 17 00:00:00 2001 From: Adrian Torres Date: Tue, 7 Apr 2020 08:57:49 +0000 Subject: [PATCH] [FIX] http: do not redirect to database manager on registry crash Before this commit if the loading of the registry failed because of an AttributeError or a psycopg2 error the http dispatcher would redirect the user to the database manager. This can be problematic because integrators (e.g. odoo.sh) may choose to disable / forbid access to the database manager, and when the registry crashes because of e.g. a migration, the real error will be overshadowed by an AccessDenied error or somesuch depending on the path taken to forbid access to the database manager. With this commit, the real exception is simply reraised closes odoo/odoo#49238 X-original-commit: de4e67dcc52916337251370387aea6aea893a60e Signed-off-by: Raphael Collet (rco) --- odoo/http.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/odoo/http.py b/odoo/http.py index 2b3472ddc9d..55484609b57 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1438,10 +1438,11 @@ class Root(object): # - the database version doesnt match the server version # Log the user out and fall back to nodb request.session.logout() - # If requesting /web this will loop if request.httprequest.path == '/web': - result = werkzeug.utils.redirect('/web/database/selector') + # Internal Server Error + raise else: + # If requesting /web this will loop result = _dispatch_nodb() else: result = ir_http._dispatch()