You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a verbatim copy of the code that is currently in master:
# Add any custom validators from extensionsforplugin_with_validatorsinp.PluginImplementations(ISpatialHarvester):
custom_validators=plugin_with_validators.get_validators()
forcustom_validatorincustom_validators:
ifcustom_validatornotinall_validators:
self._validator.add_validator(custom_validator)
In the above snippet, the custom_validators variable is a Python dictionary, as documented in the CKAN docs. The problem is that the nested for loop is iterating over the dictionary keys, which are strings, and then passes each item to self._validator.add_validator, which expects to receive a class instance instead - which by the way is also bugged, as current versions of CKAN allow using regular functions as validators.
I'm guessing this is something left behind from when CKAN moved to Flask from Pylons?
Unfortunately this is something that prevents using custom validators and customizing a harvester behavior at the same time in the same plugin class.
The text was updated successfully, but these errors were encountered:
There is a bug in
ckanext.spatial.harvesters.base.SpatialHarvester._get_validator()
ckanext-spatial/ckanext/spatial/harvesters/base.py
Line 790 in 09fbc27
This is a verbatim copy of the code that is currently in master:
In the above snippet, the
custom_validators
variable is a Python dictionary, as documented in the CKAN docs. The problem is that the nestedfor
loop is iterating over the dictionary keys, which are strings, and then passes each item toself._validator.add_validator
, which expects to receive a class instance instead - which by the way is also bugged, as current versions of CKAN allow using regular functions as validators.I'm guessing this is something left behind from when CKAN moved to Flask from Pylons?
Unfortunately this is something that prevents using custom validators and customizing a harvester behavior at the same time in the same plugin class.
The text was updated successfully, but these errors were encountered: