[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#59548 X-original-commit: 07b701c581bd960bed42fcf97fae0dfed0332656 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com> Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user