From 87cae31c7538e2f2ee425b4a489052b8101550d7 Mon Sep 17 00:00:00 2001 From: Konrad Reiche Date: Mon, 27 May 2013 13:36:56 +0200 Subject: [PATCH] Fix api_version check in the group importer code I have forgotten to update one check for the api_version 1 in the code responsible for the remote group import feature. This commit fixes that. Signed-off-by: Konrad Reiche --- README.rst | 2 +- ckanext/harvest/harvesters/ckanharvester.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 5ce5223..1d4a855 100644 --- a/README.rst +++ b/README.rst @@ -160,7 +160,7 @@ field. The currently supported configuration options are: * default_groups: A list of groups to which the harvested datasets will be added to. The groups must exist. Note that you must use ids or names to define the groups according to the API version you defined (names for version - '1', ids for version '2'). + 1, ids for version 2). * default_extras: A dictionary of key value pairs that will be added to extras of the harvested datasets. You can use the following replacement strings, diff --git a/ckanext/harvest/harvesters/ckanharvester.py b/ckanext/harvest/harvesters/ckanharvester.py index 109c437..4409990 100644 --- a/ckanext/harvest/harvesters/ckanharvester.py +++ b/ckanext/harvest/harvesters/ckanharvester.py @@ -280,7 +280,7 @@ class CKANHarvester(HarvesterBase): group.pop(key, None) get_action('group_create')(context, group) log.info('Group %s has been newly created' % group_name) - if self.api_version == '1': + if self.api_version == 1: validated_groups.append(group['name']) else: validated_groups.append(group['id'])