Commit c836d27b authored by Eteri's avatar Eteri Committed by Levin Zimmermann

start data ingestion only if corresponding data supply is validated

parent c7a6080f
...@@ -29,9 +29,11 @@ property_dict["stop_date"] = composed.getExpirationDate() ...@@ -29,9 +29,11 @@ property_dict["stop_date"] = composed.getExpirationDate()
data_ingestion.edit(**property_dict) data_ingestion.edit(**property_dict)
# create ingestion lines from specialise lines # create ingestion lines from specialise lines
for supply_line in composed.objectValues( for supply_line in composed.objectValues(
portal_type = 'Data Supply Line'): portal_type = 'Data Supply Line'):
current_line = data_ingestion.newContent( current_line = data_ingestion.newContent(
portal_type = "Data Ingestion Line", portal_type = "Data Ingestion Line",
title = supply_line.getTitle(), title = supply_line.getTitle(),
...@@ -46,6 +48,14 @@ for supply_line in composed.objectValues( ...@@ -46,6 +48,14 @@ for supply_line in composed.objectValues(
# we set quantity=0 for the data product lines # we set quantity=0 for the data product lines
current_line.setQuantity(0) current_line.setQuantity(0)
data_ingestion.start() # start ingestion only if data supply is validated
data_supply_validated = True
for specialise_path in specialise_list:
specialise = portal.restrictedTraverse(specialise_path)
if specialise.getPortalType() == "Data Supply":
if specialise.getValidationState() != "validated":
data_supply_validated = False
if data_supply_validated:
data_ingestion.start()
return data_ingestion return data_ingestion
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