From 7ffd6748f36a2ab3341e66835d3e896b67f2c905 Mon Sep 17 00:00:00 2001 From: Mark Winterbottom Date: Mon, 2 Nov 2015 16:59:43 +0000 Subject: [PATCH] Corrected docstring params field, duplicate if statement and deleting keys for blank values. --- ckanext/harvest/logic/action/delete.py | 2 ++ ckanext/harvest/logic/action/update.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ckanext/harvest/logic/action/delete.py b/ckanext/harvest/logic/action/delete.py index 5b1842a..88ae8b9 100644 --- a/ckanext/harvest/logic/action/delete.py +++ b/ckanext/harvest/logic/action/delete.py @@ -12,6 +12,8 @@ def harvest_source_delete(context, data_dict): This method just proxies the request to package_delete, which will delete the actual harvest type dataset and the HarvestSource object (via the after_delete extension point). + + :param id: the name or id of the harvest source to delete ''' log.info('Deleting harvest source: %r', data_dict) diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py index 284433e..7c21905 100644 --- a/ckanext/harvest/logic/action/update.py +++ b/ckanext/harvest/logic/action/update.py @@ -285,7 +285,7 @@ def harvest_objects_import(context, data_dict): segments = context.get('segments') - join_datasets = context.get('join_datasets') + join_datasets = context.get('join_datasets', True) if source_id: source = HarvestSource.get(source_id) @@ -560,9 +560,8 @@ def harvest_source_reindex(context, data_dict): if package_dict.get('config'): config = json.loads(package_dict['config']) for key, value in package_dict.iteritems(): - if value: - if value and key not in config: - new_dict[key] = value + if key not in config: + new_dict[key] = value package_index = PackageSearchIndex() package_index.index_package(