use hasattr for config validation

This commit is contained in:
Friedrich Lindenberg 2011-06-09 11:35:58 +02:00
parent 7b61fb62bf
commit 13f2fb3b96
2 changed files with 1 additions and 5 deletions

View File

@ -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:

View File

@ -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):