From e7384106c3ecfeb4102e4118e6ae9aaff56dcb36 Mon Sep 17 00:00:00 2001 From: Bruce Bolt Date: Thu, 25 Oct 2018 10:32:50 +0100 Subject: [PATCH] A harvester may not have an info method This fixes the error `AttributeError: 'HarvesterBase' object has no attribute 'info'` which prevents new harvest sources from being created. --- ckanext/harvest/logic/validators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ckanext/harvest/logic/validators.py b/ckanext/harvest/logic/validators.py index 1cfba34..54dce86 100644 --- a/ckanext/harvest/logic/validators.py +++ b/ckanext/harvest/logic/validators.py @@ -113,7 +113,10 @@ def harvest_source_type_exists(value, context): # Get all the registered harvester types available_types = [] for harvester in PluginImplementations(IHarvester): - info = harvester.info() + try: + info = harvester.info() + except AttributeError: + continue if not info or 'name' not in info: log.error('Harvester %s does not provide the harvester name in ' 'the info response' % harvester)