diff --git a/ckanext/dcat/harvesters/_json.py b/ckanext/dcat/harvesters/_json.py index a81d2c1a..5e2d5c2d 100644 --- a/ckanext/dcat/harvesters/_json.py +++ b/ckanext/dcat/harvesters/_json.py @@ -193,9 +193,10 @@ def import_stage(self, harvest_object): context, {'id': harvest_object.package_id}) log.info('Deleted package {0} with guid {1}' .format(harvest_object.package_id, harvest_object.guid)) - + model.Session.query(HarvestObject).\ - filter_by(guid=guid).\ + filter_by(guid=harvest_object.guid).\ + filter_by(current=True).\ update({'current': False}, False) return True