log("Data Ingestion by id-date found: "+str(document))
if(documentisnotNone):
ifdocument.getSimulationState()=='planned':
data_ingestion=document
else:
raiseValueError("Could not create Data Ingestion for reference %s. An older ingestion for that file was already done. Please review the reference."%data_ingestion_reference)
raiseValueError("An older ingestion for reference %s was already done."%data_ingestion_reference)
ifdata_ingestionisNone:
log("data_ingestion is NONE! Searching for a validated Data Supply...")