Commit 92e13bbb authored by Romain Courteaud's avatar Romain Courteaud

getWebSectionValueList should return nothing if no web section is visible.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26334 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc584473
...@@ -220,26 +220,30 @@ class WebSite(WebSection): ...@@ -220,26 +220,30 @@ class WebSite(WebSection):
id='WebSite._getWebSectionUidList', id='WebSite._getWebSectionUidList',
cache_factory='erp5_content_medium') cache_factory='erp5_content_medium')
section_list = self.portal_domains.searchPredicateList(document, web_section_uid_list = _getWebSectionUidList(self)
portal_type='Web Section', if web_section_uid_list:
uid=_getWebSectionUidList(self)) section_list = self.portal_domains.searchPredicateList(document,
portal_type='Web Section',
uid=web_section_uid_list)
section_dict = {} section_dict = {}
for section in section_list: for section in section_list:
section_dict[section.getPhysicalPath()] = section section_dict[section.getPhysicalPath()] = section
# Eliminate path # Eliminate path
for section in section_list: for section in section_list:
path = section.getPhysicalPath() path = section.getPhysicalPath()
for i in range(0, len(path)-1): for i in range(0, len(path)-1):
sub_path = path[0:i] sub_path = path[0:i]
if section_dict.has_key(sub_path): if section_dict.has_key(sub_path):
del section_dict[sub_path] del section_dict[sub_path]
section_list = section_dict.values() section_list = section_dict.values()
# Sort by Index # Sort by Index
section_list.sort(key=lambda x: x.getIntIndex()) section_list.sort(key=lambda x: x.getIntIndex())
return section_list return section_list
else:
return []
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