Commit 45ce4da0 authored by iv's avatar iv

ERP5Workflow: fix aquisition when sorting the object list in objectValues

This fixes testSimulationElementPerformance (AttributeError: aq_inner)
parent 7e798ef3
......@@ -118,7 +118,7 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
if meta_type.startswith('ERP5 ')]
try:
object_list = self._object_dict.values()
object_list = [o.__of__(self) for o in self._object_dict.values()]
except AttributeError:
if self._object_dict is None:
return []
......@@ -127,14 +127,13 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
if portal_type is not None:
if isinstance(portal_type, str):
portal_type = (portal_type,)
object_list = [x for x in object_list if x.getPortalType() in portal_type]
object_list = [o for o in object_list if o.getPortalType() in portal_type]
if checked_permission is not None:
checkPermission = getSecurityManager().checkPermission
object_list = [o for o in object_list
if checkPermission(checked_permission, o)]
return [x.__of__(self) for x in sortValueList(object_list, sort_on,
sort_order, **kw)]
return sortValueList(object_list, sort_on, sort_order, **kw)
security.declareProtected(Permissions.AccessContentsInformation,
'keys', 'items', 'values')
......
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