[ckan-changes] commit/ckanext-harvest: pudo: use hasattr for config validation

Bitbucket commits-noreply at bitbucket.org
Thu Jun 9 09:36:16 UTC 2011


1 new changeset in ckanext-harvest:

http://bitbucket.org/okfn/ckanext-harvest/changeset/079e425bbd8d/
changeset:   079e425bbd8d
user:        pudo
date:        2011-06-09 11:35:58
summary:     use hasattr for config validation
affected #:  2 files (165 bytes)

--- a/ckanext/harvest/logic/validators.py	Tue Jun 07 15:32:46 2011 +0100
+++ b/ckanext/harvest/logic/validators.py	Thu Jun 09 11:35:58 2011 +0200
@@ -83,10 +83,7 @@
     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:


--- a/ckanext/harvest/plugin.py	Tue Jun 07 15:32:46 2011 +0100
+++ b/ckanext/harvest/plugin.py	Thu Jun 09 11:35:58 2011 +0200
@@ -34,7 +34,6 @@
 
         map.connect('harvesting_job_create', '/harvest/refresh/:id',controller=controller, 
                 action='create_harvesting_job')
-      
         return map
 
     def update_config(self, config):

Repository URL: https://bitbucket.org/okfn/ckanext-harvest/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list