[#83] Fix key error when using default_groups

This commit is contained in:
amercader 2014-02-10 13:16:58 +00:00
parent 3693028009
commit 5b677b6099
1 changed files with 2 additions and 0 deletions

View File

@ -338,6 +338,8 @@ class CKANHarvester(HarvesterBase):
# Set default groups if needed
default_groups = self.config.get('default_groups', [])
if default_groups:
if not 'groups' in package_dict:
package_dict['groups'] = []
package_dict['groups'].extend([g for g in default_groups if g not in package_dict['groups']])
# Find any extras whose values are not strings and try to convert