[#17] Fix bug with remote groups handling
If neither 'only_local' or 'create' are used the remote groups property needs to be removed, otherwise it causes an exception when the group is not found.
This commit is contained in:
parent
ff7287d4b4
commit
361abcfc07
|
@ -247,11 +247,14 @@ class CKANHarvester(HarvesterBase):
|
|||
package_dict['tags'] = []
|
||||
package_dict['tags'].extend([t for t in default_tags if t not in package_dict['tags']])
|
||||
|
||||
remote_groups = self.config.get('remote_groups', None)
|
||||
if not remote_groups in ('only_local', 'create'):
|
||||
# Ignore remote groups
|
||||
package_dict.pop('groups', None)
|
||||
else:
|
||||
if not 'groups' in package_dict:
|
||||
package_dict['groups'] = []
|
||||
|
||||
remote_groups = self.config.get('remote_groups', None)
|
||||
if remote_groups in ('only_local', 'create'):
|
||||
# check if remote groups exist locally, otherwise remove
|
||||
validated_groups = []
|
||||
context = {'model': model, 'session': Session, 'user': 'harvest'}
|
||||
|
|
Loading…
Reference in New Issue