Commit 0bb61545 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Return an empty list when failing in getting a selection.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@559 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 23e14eac
......@@ -665,6 +665,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
Get the list of values selected for 'selection_name'
"""
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection is None:
return []
return selection(selection_method=selection_method, context=context, REQUEST=REQUEST)
security.declareProtected(ERP5Permissions.View, 'getSelectionCheckedValueList')
......@@ -673,6 +675,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
Get the list of values checked for 'selection_name'
"""
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection is None:
return []
uid_list = selection.getSelectionCheckedUids()
value_list = self.portal_catalog.getObjectList(uid_list)
return value_list
......
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