From 5b677b60997fbd95a1c9ef6bfab6f8bb4cc0e711 Mon Sep 17 00:00:00 2001 From: amercader Date: Mon, 10 Feb 2014 13:16:58 +0000 Subject: [PATCH] [#83] Fix key error when using default_groups --- ckanext/harvest/harvesters/ckanharvester.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ckanext/harvest/harvesters/ckanharvester.py b/ckanext/harvest/harvesters/ckanharvester.py index d42ef6d..583ca37 100644 --- a/ckanext/harvest/harvesters/ckanharvester.py +++ b/ckanext/harvest/harvesters/ckanharvester.py @@ -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