diff --git a/ckanext/harvest/logic/action/delete.py b/ckanext/harvest/logic/action/delete.py index cf22363..5b1842a 100644 --- a/ckanext/harvest/logic/action/delete.py +++ b/ckanext/harvest/logic/action/delete.py @@ -7,14 +7,12 @@ log = logging.getLogger(__name__) def harvest_source_delete(context, data_dict): - """ - Deletes an existing harvest source + '''Deletes an existing harvest source. 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). - - """ + ''' 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 75d99d5..c1f260e 100644 --- a/ckanext/harvest/logic/action/update.py +++ b/ckanext/harvest/logic/action/update.py @@ -440,7 +440,7 @@ def harvest_sources_reindex(context, data_dict): @logic.side_effect_free def harvest_source_reindex(context, data_dict): - """Reindex a single harvest source.""" + '''Reindex a single harvest source.''' harvest_source_id = logic.get_or_bust(data_dict, 'id') defer_commit = context.get('defer_commit', False) diff --git a/ckanext/harvest/logic/validators.py b/ckanext/harvest/logic/validators.py index aa5ca15..01e73ef 100644 --- a/ckanext/harvest/logic/validators.py +++ b/ckanext/harvest/logic/validators.py @@ -25,7 +25,8 @@ def harvest_source_id_exists(value, context): def harvest_job_exists(value, context): - """Check if a harvest job exists and returns the model if it does""" + '''Check if a harvest job exists and returns the model if it does''' + result = HarvestJob.get(value, None) if not result: @@ -60,10 +61,10 @@ def _normalize_url(url): def harvest_source_url_validator(key, data, errors, context): - """Validate the provided harvest source URL. + '''Validate the provided harvest source URL. Checks that the URL is not already existing with the same config. - """ + ''' package = context.get("package")