Merge branch 'metaodi-117-url-already-in-use'

This commit is contained in:
amercader 2015-01-14 11:16:26 +00:00
commit a71cc495fb
1 changed files with 5 additions and 2 deletions

View File

@ -201,8 +201,11 @@ class HarvesterBase(SingletonPlugin):
# exception
context.pop('__auth_audit', None)
# Set name if not already there
package_dict.setdefault('name', self._gen_new_name(package_dict['title']))
# Set name for new package to prevent name conflict, see issue #117
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'])
log.info('Package with GUID %s does not exist, let\'s create it' % harvest_object.guid)
harvest_object.current = True