From f028375ad3144f6f3e0fb12b434fc2427ca9bee1 Mon Sep 17 00:00:00 2001 From: Vitor Baptista Date: Sun, 18 Aug 2013 12:08:30 -0300 Subject: [PATCH] [#62] Use current name when updating package, if the user haven't sent a new one It's hard for someone outside CKAN to make sure they're sending it in the format we expect. And they'll also have to keep track of our name format, to keep in sync whenever we change. To fix this, we simply do what we already do when creating packages: use a default name. In this case, the current one. --- ckanext/harvest/harvesters/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ckanext/harvest/harvesters/base.py b/ckanext/harvest/harvesters/base.py index c143179..19dd393 100644 --- a/ckanext/harvest/harvesters/base.py +++ b/ckanext/harvest/harvesters/base.py @@ -166,6 +166,8 @@ class HarvesterBase(SingletonPlugin): log.info('Package with GUID %s exists and needs to be updated' % harvest_object.guid) # Update package context.update({'id':package_dict['id']}) + package_dict.setdefault('name', + existing_package_dict['name']) new_package = get_action('package_update_rest')(context, package_dict) else: