Commit d723bc70 authored by Kevin Deldycke's avatar Kevin Deldycke

Normalize web parameters

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9560 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 67c801cd
......@@ -148,6 +148,14 @@ class WebSite(Domain):
the WebSite_getDocumentValue script
"""
request = self.REQUEST
# Normalize web parameter in the request
# Fix common user mistake and transform '1' string to boolean
for web_param in ['ignore_layout', 'editable_mode']:
if hasattr(request, web_param):
if getattr(request, web_param, None) in ('1', 1, True):
request.set(web_param, True)
else:
request.set(web_param, False)
# Register current web site physical path for later URL generation
if not request.has_key(WEBSITE_KEY):
request[WEBSITE_KEY] = self.getPhysicalPath()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment