Commit 0df7e6f4 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Skip to call catalog if uid_list is empty

    if uid is empty it returns whole catalog
parent 44c96349
......@@ -13,7 +13,11 @@ def filter_per_portal_type(document):
and document.getValidationState() == "validated":
return document
return portal.portal_catalog(uid=[i.uid
for i in context.portal_simulation.getCurrentTrackingList(
uid_list = [i.uid for i in context.portal_simulation.getCurrentTrackingList(
node_uid=context.getUid(), at_date=DateTime())
if filter_per_portal_type(i.getObject())], **kw)
if filter_per_portal_type(i.getObject())]
if not uid_list:
return []
return portal.portal_catalog(uid=uid_list, **kw)
......@@ -13,7 +13,11 @@ def filter_per_portal_type(document):
and document.getValidationState() == "validated":
return document
return portal.portal_catalog(uid=[i.uid
for i in context.portal_simulation.getCurrentTrackingList(
uid_list = [i.uid for i in context.portal_simulation.getCurrentTrackingList(
project_uid=context.getUid(), at_date=DateTime())
if filter_per_portal_type(i.getObject())], **kw)
if filter_per_portal_type(i.getObject())]
if not uid_list:
return []
return portal.portal_catalog(uid=uid_list, **kw)
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