From ea9debf714ded2031f808f0aeaac83aad2650d8c Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Thu, 18 Dec 2014 16:03:33 +0100 Subject: [PATCH] Fix logic of conditional and make it more pythonic --- ckanext/harvest/harvesters/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/harvest/harvesters/base.py b/ckanext/harvest/harvesters/base.py index a97ecc3..b4db6ce 100644 --- a/ckanext/harvest/harvesters/base.py +++ b/ckanext/harvest/harvesters/base.py @@ -202,7 +202,7 @@ class HarvesterBase(SingletonPlugin): context.pop('__auth_audit', None) # Set name for new package to prevent name conflict, see issue #117 - if ('name' in package_dict and not package_dict['name']): + if package_dict.get('name', None): package_dict['name'] = self._gen_new_name(package_dict['name']) else: package_dict['name'] = self._gen_new_name(package_dict['title'])