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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed May 28 10:26:23 CEST 2008


Author: jp
Date: Wed May 28 10:26:23 2008
New Revision: 21181

URL: http://svn.erp5.org?rev=21181&view=rev
Log:
Try to make the request temp parameter more robust (revert this change if it causes more troubles than solution)

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=21181&r1=21180&r2=21181&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/WebSite.py (original)
+++ erp5/trunk/products/ERP5/Document/WebSite.py Wed May 28 10:26:23 2008
@@ -60,7 +60,9 @@
     # Every Web Section acts as a mini site though layout for document editing is the root layout
     #website_path = self._v_request.get(WEBSECTION_KEY, self._v_request.get(WEBSITE_KEY, None))
     # Only consider Web Site for absolute_url
-    website_path = self._v_request.get(WEBSITE_KEY, None) 
+    request = getattr(self, '_v_request', None)
+    if request is None: request = self._v_request = get_request()
+    website_path = request.get(WEBSITE_KEY, None) 
     if website_path:
       website_path = tuple(website_path)    # Make sure all path are tuples
       path = tuple(path)                    # Make sure all path are tuples
@@ -80,7 +82,7 @@
       # Insert the web site path after the common part of the path
       if path_len > common_index + 1:
         path = website_path + path[common_index + 1:]
-    rpp = self._v_request.other.get('VirtualRootPhysicalPath', ('', ))
+    rpp = request.other.get('VirtualRootPhysicalPath', ('', ))
     i = 0
     for name in rpp[:len(path)]:
       if path[i] == name:




More information about the Erp5-report mailing list