summaryrefslogtreecommitdiff
path: root/addons/website/models
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2020-10-08 14:57:03 +0000
committerRomain Derie <rde@odoo.com>2020-10-08 15:15:53 +0000
commit07b701c581bd960bed42fcf97fae0dfed0332656 (patch)
tree546870df7a3d3d69e51375cbf49136d73dd9a7d6 /addons/website/models
parent59a76fef373f6a4bf24125af835f8094b509b61e (diff)
[FIX] website: prevent redirect loop on / if no homepage
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#59530 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/website/models')
-rw-r--r--addons/website/models/ir_http.py2
1 files changed, 1 insertions, 1 deletions
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: