Merge branch 'ogdch-79-optional-tag-munging'
This commit is contained in:
commit
3693028009
|
@ -206,6 +206,12 @@ field. The currently supported configuration options are:
|
|||
present in the local CKAN. Setting it to 'create' will make an attempt to
|
||||
create the organizations by copying the details from the remote CKAN.
|
||||
|
||||
* clean_tags: By default, tags are not stripped of accent characters, spaces and
|
||||
capital letters for display. If this option is set to True, accent characters
|
||||
will be replaced by their ascii equivalents, capital letters replaced by
|
||||
lower-case ones, and spaces replaced with dashes. Setting this option to False
|
||||
gives the same effect as leaving it unset.
|
||||
|
||||
Here is an example of a configuration object (the one that must be entered in
|
||||
the configuration field)::
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ from ckanext.harvest.model import HarvestJob, HarvestObject, HarvestGatherError,
|
|||
from ckan.plugins.core import SingletonPlugin, implements
|
||||
from ckanext.harvest.interfaces import IHarvester
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -150,6 +151,7 @@ class HarvesterBase(SingletonPlugin):
|
|||
'ignore_auth': True,
|
||||
}
|
||||
|
||||
if self.config and self.config.get('clean_tags', False):
|
||||
tags = package_dict.get('tags', [])
|
||||
tags = [munge_tag(t) for t in tags]
|
||||
tags = list(set(tags))
|
||||
|
|
Loading…
Reference in New Issue