[Erp5-report] r9560 - /erp5/trunk/products/ERP5/Document/WebSite.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 30 16:16:56 CEST 2006


Author: kevin
Date: Wed Aug 30 16:16:55 2006
New Revision: 9560

URL: http://svn.erp5.org?rev=9560&view=rev
Log:
Normalize web parameters

Modified:
    erp5/trunk/products/ERP5/Document/WebSite.py

Modified: erp5/trunk/products/ERP5/Document/WebSite.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/WebSite.py?rev=9560&r1=9559&r2=9560&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/WebSite.py (original)
+++ erp5/trunk/products/ERP5/Document/WebSite.py Wed Aug 30 16:16:55 2006
@@ -148,6 +148,14 @@
         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()




More information about the Erp5-report mailing list