From 67366093fec2d6ae866c3b7826ad3054e45cc78c Mon Sep 17 00:00:00 2001 From: David Read Date: Tue, 8 Dec 2015 10:06:42 +0000 Subject: [PATCH] [#205] Remove harvest_source_for_a_dataset action. It has been deprecated since Mar 6 16:54:33 2013 and returns wrong harvest stats keys. --- ckanext/harvest/logic/action/get.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/ckanext/harvest/logic/action/get.py b/ckanext/harvest/logic/action/get.py index 4fbb5ac..8716ea2 100644 --- a/ckanext/harvest/logic/action/get.py +++ b/ckanext/harvest/logic/action/get.py @@ -131,30 +131,6 @@ def harvest_source_list(context, data_dict): context.update({'detailed':False}) return [harvest_source_dictize(source, context) for source in sources] -@side_effect_free -def harvest_source_for_a_dataset(context, data_dict): - ''' - TODO: Deprecated, harvest source id is added as an extra to each dataset - automatically - ''' - '''For a given dataset, return the harvest source that - created or last updated it, otherwise NotFound.''' - - model = context['model'] - session = context['session'] - - dataset_id = data_dict.get('id') - - query = session.query(HarvestSource)\ - .join(HarvestObject)\ - .filter_by(package_id=dataset_id)\ - .order_by(HarvestObject.gathered.desc()) - source = query.first() # newest - - if not source: - raise NotFound - - return harvest_source_dictize(source,context) @side_effect_free def harvest_job_show(context,data_dict):