From e38e64b36f8cf6098e698dd7ac68d525a6408835 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Thu, 8 Oct 2020 14:57:03 +0000 Subject: [PATCH] [FIX] website: prevent redirect loop on / if no homepage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 3d65424708d, if the homepage does not exists (no page with '/' as URL, no page set as homepage), it would loop between / controller and _serve_page. task-2250381 closes odoo/odoo#59548 X-original-commit: 07b701c581bd960bed42fcf97fae0dfed0332656 Signed-off-by: Jérémy Kersten (jke) Signed-off-by: Romain Derie --- addons/website/models/ir_http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index cd06de4b75a..603e4d9ff38 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -251,7 +251,7 @@ class Http(models.AbstractModel): page = request.env['website.page'].sudo().search(published_domain, order='website_id asc', limit=1) # redirect withtout trailing / - if not page and req_page.endswith("/"): # / handled by controller + if not page and req_page != "/" and req_page.endswith("/"): return request.redirect(req_page[:-1]) if page: