Commit a53169bc authored by Ivan Tyagov's avatar Ivan Tyagov

Fix properly condition as we care if we find results and return explicitly if no results exists.

parent 5d603cb4
...@@ -6,7 +6,7 @@ catalog_kw = {'portal_type': 'Data Ingestion Line', ...@@ -6,7 +6,7 @@ catalog_kw = {'portal_type': 'Data Ingestion Line',
'limit': limit, 'limit': limit,
} }
data_ingestion_line_list = context.portal_catalog(**catalog_kw) data_ingestion_line_list = context.portal_catalog(**catalog_kw)
if data_ingestion_line_list: if len(data_ingestion_line_list):
data_ingestion_uid_list = [x.uid for x in data_ingestion_line_list] data_ingestion_uid_list = [x.uid for x in data_ingestion_line_list]
catalog_kw = {'portal_type': 'Data Stream', catalog_kw = {'portal_type': 'Data Stream',
'aggregate__related__uid': data_ingestion_uid_list, 'aggregate__related__uid': data_ingestion_uid_list,
...@@ -14,4 +14,4 @@ if data_ingestion_line_list: ...@@ -14,4 +14,4 @@ if data_ingestion_line_list:
'select_list': ['reference', 'relative_url', 'versioning.size', 'versioning.version'], 'select_list': ['reference', 'relative_url', 'versioning.size', 'versioning.version'],
} }
return context.getPortalObject().portal_catalog(**catalog_kw) return context.getPortalObject().portal_catalog(**catalog_kw)
return data_ingestion_line_list 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