From 888e2c3d3728afd34d6f5ee4d266f4d68a131d8b Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 28 Mar 2018 17:33:04 +0200 Subject: [PATCH] [FIX] website: fix controller / to avoid loop Don't redirect to '' to avoid infinite redirect loop. --- addons/website/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index dad87420ecb..425859decd9 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -75,7 +75,7 @@ class Website(Home): else: top_menu = request.website.menu_id first_menu = top_menu and top_menu.child_id and top_menu.child_id.filtered(lambda menu: menu.is_visible) - if first_menu and first_menu[0].url != '/' and (not (first_menu[0].url.startswith(('/?', '/#')))): + if first_menu and first_menu[0].url not in ('/', '') and (not (first_menu[0].url.startswith(('/?', '/#', ' ')))): return request.redirect(first_menu[0].url) raise request.not_found()