From 5c80ca4d1df93025b8d95e9bfb5ada86c5d84650 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 24 Oct 2022 12:22:41 +0000 Subject: [PATCH] [FIX] http: nodb fallback in case of connection error When calling a `auth=none` route with a non-existing DB name, the server redirects to `/web/database/selector`. Such a route can be called without database, therefore it is expected to work if the database doesn't exist as well. Before the HTTP refactoring, the fallback was `_dispatch_nodb` [1]. We roll back to the same behavior since there is no good reason to redirect to `/web/database/selector`. Commits 4b330f3173eb0 and de4e67dcc529163 are reintroduced as well. [1] https://github.com/odoo/odoo/blob/b3199e949ae70307e8181ba0d6237871d6d07af7/odoo/http.py#L1529 closes odoo/odoo#104174 X-original-commit: 1565e85890f1d14e067edd1c198c7199ab536307 Signed-off-by: Nicolas Martinelli (nim) Signed-off-by: Olivier Dony --- odoo/http.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/odoo/http.py b/odoo/http.py index 7b2b3885208..e41ee2f3b81 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1525,7 +1525,11 @@ class Request: self.db = None self.session.db = None root.session_store.save(self.session) - return self.redirect('/web/database/selector') + if request.httprequest.path == '/web': + # Internal Server Error + raise + else: + return self._serve_nodb() with contextlib.closing(self.registry.cursor()) as cr: self.env = odoo.api.Environment(cr, self.session.uid, self.session.context)