'Activate a repository that was deactivated but not uninstalled.'

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

    repository_id = kwd['id']
    repository = repository_util.get_installed_tool_shed_repository(trans.app, repository_id)
    try:
        trans.app.installed_repository_manager.activate_repository(repository)
    except Exception as e:
        error_message = ('Error    activating    repository    %s:    %s' % (escape(repository.name), str(e)))
        log.exception(error_message)
        message = ('%s.<br/>You    may    be    able    to    resolve    this    by    uninstalling    and    then    reinstalling    the    repository.        Click    <a    href="%s">here</a>    to    uninstall    the    repository.' % (error_message, web.url_for(controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id(repository.id))))
        status = 'error'
        return trans.response.send_redirect(web.url_for(controller='admin_toolshed', action='manage_repository', id=repository_id, message=message, status=status))
    message = ('The    <b>%s</b>    repository    has    been    activated.' % escape(repository.name))
    status = 'done'
    return trans.response.send_redirect(web.url_for(controller='admin_toolshed', action='browse_repositories', message=message, status=status))
