From 13f2fb3b96703bfd251bb66dd28c8de3dcd02989 Mon Sep 17 00:00:00 2001 From: Friedrich Lindenberg Date: Thu, 9 Jun 2011 11:35:58 +0200 Subject: [PATCH] use hasattr for config validation --- ckanext/harvest/logic/validators.py | 5 +---- ckanext/harvest/plugin.py | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ckanext/harvest/logic/validators.py b/ckanext/harvest/logic/validators.py index d555e3d..3f7120f 100644 --- a/ckanext/harvest/logic/validators.py +++ b/ckanext/harvest/logic/validators.py @@ -83,10 +83,7 @@ def harvest_source_config_validator(key,data,errors,context): for harvester in PluginImplementations(IHarvester): info = harvester.info() if info['name'] == harvester_type: - if info.get('form_config_interface','') != 'Text': - raise Invalid('This harvester does not allow configuration options: %s' % harvester_type) - - if harvester.validate_config: + if hasattr(harvester, 'validate_config'): try: return harvester.validate_config(data[key]) except Exception, e: diff --git a/ckanext/harvest/plugin.py b/ckanext/harvest/plugin.py index 227f05b..f0d8a81 100644 --- a/ckanext/harvest/plugin.py +++ b/ckanext/harvest/plugin.py @@ -34,7 +34,6 @@ class Harvest(SingletonPlugin): map.connect('harvesting_job_create', '/harvest/refresh/:id',controller=controller, action='create_harvesting_job') - return map def update_config(self, config):