'An error occurred while cloning the repository, so reset everything necessary to enable another attempt.'

@web.expose
@web.require_admin
def reset_to_install(self, trans, **kwd):

    repository = repository_util.get_installed_tool_shed_repository(trans.app, kwd['id'])
    if kwd.get('reset_repository', False):
        repository_util.set_repository_attributes(trans.app, repository, status=trans.install_model.ToolShedRepository.installation_status.NEW, error_message=None, deleted=False, uninstalled=False, remove_from_disk=True)
        new_kwd = {}
        new_kwd['message'] = ('You    can    now    attempt    to    install    the    repository    named    <b>%s</b>    again.' % escape(str(repository.name)))
        new_kwd['status'] = 'done'
        return trans.response.send_redirect(web.url_for(controller='admin_toolshed', action='browse_repositories', **new_kwd))
    return trans.response.send_redirect(web.url_for(controller='admin_toolshed', action='manage_repository', **kwd))
