Fix logic of conditional and make it more pythonic

This commit is contained in:
Stefan Oderbolz 2014-12-18 16:03:33 +01:00
parent 08930d01bf
commit ea9debf714
1 changed files with 1 additions and 1 deletions

View File

@ -202,7 +202,7 @@ class HarvesterBase(SingletonPlugin):
context.pop('__auth_audit', None) context.pop('__auth_audit', None)
# Set name for new package to prevent name conflict, see issue #117 # 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']) package_dict['name'] = self._gen_new_name(package_dict['name'])
else: else:
package_dict['name'] = self._gen_new_name(package_dict['title']) package_dict['name'] = self._gen_new_name(package_dict['title'])