[#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.
This commit is contained in:
amercader 2014-02-11 17:27:19 +00:00
parent 5739e541d7
commit fbde0b8dc1
1 changed files with 5 additions and 0 deletions

View File

@ -373,6 +373,11 @@ class CKANHarvester(HarvesterBase):
package_dict['extras'][key] = value 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) result = self._create_or_update_package(package_dict,harvest_object)
if result and self.config.get('read_only',False) == True: if result and self.config.get('read_only',False) == True: