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

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 7 15:22:47 CEST 2009


Author: romain
Date: Tue Apr  7 15:22:43 2009
New Revision: 26334

URL: http://svn.erp5.org?rev=26334&view=rev
Log:
getWebSectionValueList should return nothing if no web section is visible.

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=26334&r1=26333&r2=26334&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/WebSite.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/WebSite.py [utf8] Tue Apr  7 15:22:43 2009
@@ -220,26 +220,30 @@
                          id='WebSite._getWebSectionUidList',
                          cache_factory='erp5_content_medium')
 
-      section_list = self.portal_domains.searchPredicateList(document, 
-                        portal_type='Web Section',
-                        uid=_getWebSectionUidList(self))
-
-      section_dict = {}
-
-      for section in section_list:
-        section_dict[section.getPhysicalPath()] = section
-
-      # Eliminate path
-      for section in section_list:
-        path = section.getPhysicalPath()
-        for i in range(0, len(path)-1):
-          sub_path = path[0:i]
-          if section_dict.has_key(sub_path):
-            del section_dict[sub_path]
-
-      section_list = section_dict.values()
-
-      # Sort by Index
-      section_list.sort(key=lambda x: x.getIntIndex())
-
-      return section_list
+      web_section_uid_list = _getWebSectionUidList(self)
+      if web_section_uid_list:
+        section_list = self.portal_domains.searchPredicateList(document, 
+                          portal_type='Web Section',
+                          uid=web_section_uid_list)
+
+        section_dict = {}
+
+        for section in section_list:
+          section_dict[section.getPhysicalPath()] = section
+
+        # Eliminate path
+        for section in section_list:
+          path = section.getPhysicalPath()
+          for i in range(0, len(path)-1):
+            sub_path = path[0:i]
+            if section_dict.has_key(sub_path):
+              del section_dict[sub_path]
+
+        section_list = section_dict.values()
+
+        # Sort by Index
+        section_list.sort(key=lambda x: x.getIntIndex())
+
+        return section_list
+      else:
+        return []




More information about the Erp5-report mailing list