summaryrefslogtreecommitdiff
path: root/addons/website/controllers/main.py
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-11-26 10:02:41 +0100
committerDenis Ledoux <dle@odoo.com>2015-11-26 10:02:41 +0100
commitb459c4dc0324e2a3949d02ae246f4233cd6131ea (patch)
treedbb0922fc6a560e209e2a8a0d87370b66c45821d /addons/website/controllers/main.py
parent5c0fd9780e1509e0c62ee33e1c305d1d01530f21 (diff)
[FIX] website: possibility to set no url for the home menu
Unsetting the URL of the menu `Home`, in Settings > Configuration > Website Settings > Configure Website, leaded to the unavailability of the website. opw-657572
Diffstat (limited to 'addons/website/controllers/main.py')
-rw-r--r--addons/website/controllers/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py
index 7ef9dbe38b2..3862d19f0f8 100644
--- a/addons/website/controllers/main.py
+++ b/addons/website/controllers/main.py
@@ -40,9 +40,9 @@ class Website(openerp.addons.web.controllers.main.Home):
else:
first_menu = main_menu.child_id and main_menu.child_id[0]
if first_menu:
- if not (first_menu.url.startswith(('/page/', '/?', '/#')) or (first_menu.url=='/')):
+ if first_menu.url and (not (first_menu.url.startswith(('/page/', '/?', '/#')) or (first_menu.url == '/'))):
return request.redirect(first_menu.url)
- if first_menu.url.startswith('/page/'):
+ if first_menu.url and first_menu.url.startswith('/page/'):
return request.registry['ir.http'].reroute(first_menu.url)
return self.page(page)