From fbde0b8dc1f0a607f7d2fa0ea92fd5f6bb86cec6 Mon Sep 17 00:00:00 2001 From: amercader Date: Tue, 11 Feb 2014 17:27:19 +0000 Subject: [PATCH] [#87] Remove remote url_type from resources Otherwise CKAN thinks they are uploads, datastore resources, etc, which it can cause problems eg when displaying the URL of the resource. We are just linking to the remote resource URL. --- ckanext/harvest/harvesters/ckanharvester.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ckanext/harvest/harvesters/ckanharvester.py b/ckanext/harvest/harvesters/ckanharvester.py index 583ca37..835e27c 100644 --- a/ckanext/harvest/harvesters/ckanharvester.py +++ b/ckanext/harvest/harvesters/ckanharvester.py @@ -373,6 +373,11 @@ class CKANHarvester(HarvesterBase): package_dict['extras'][key] = value + # Clear remote url_type for resources (eg datastore, upload) as we + # are only creating normal resources with links to the remote ones + for resource in package_dict.get('resources', []): + resource.pop('url_type', None) + result = self._create_or_update_package(package_dict,harvest_object) if result and self.config.get('read_only',False) == True: