Commit 075059cf authored by Roque Porchetto's avatar Roque Porchetto

erp5_wendelin_telecom_ingestion: minor fix in dataset invalidation script

parent 94e6e46b
......@@ -7,13 +7,14 @@ object = state_change['object']
if object.getPortalType() == "Data Set":
data_set = object
context.logEntry("Invalidating data set '%s' and dependencies." % data_set.getReference())
data_set.setReference(data_set.getReference() + "_invalid")
reference_query = Query(**{'reference': data_set.getReference()+'/%'})
reference_query = Query(**{'reference': data_set.getReference() +'/%'})
kw_dict = {"portal_type": "Data Stream",
"query": reference_query}
for data_stream in portal_catalog(**kw_dict):
if data_stream.getReference().startswith(data_set.getReference()+'/') and not data_stream.getReference().endswith("_invalid"):
portal.ERP5Site_invalidateIngestionObjects(data_stream.getReference())
data_set.setReference(data_set.getReference() + "_invalid")
data_set.setVersion("000")
elif object.getPortalType() == "Data Stream":
data_stream = object
portal.ERP5Site_invalidateIngestionObjects(data_stream.getReference())
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