manage.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:repocribro 作者: MarekSuchanek 项目源码 文件源码
def organization(login):
    """List organization repositories for activation

    .. :todo: register organization in repocribro
    .. :todo: own profile page of organization
    """
    ORG_REPOS_URL = '/orgs/{}/repos?type=member'
    page = int(flask.request.args.get('page', 0))
    gh_api = flask.current_app.container.get(
        'gh_api', token=flask.session['github_token']
    )

    gh_repos = gh_api.get(ORG_REPOS_URL.format(login), page=page)
    user = flask_login.current_user.github_user
    active_ids = [repo.github_id for repo in user.repositories]
    return flask.render_template(
        'manage/repos.html', repos=gh_repos.data,
        actual_page=gh_repos.actual_page, total_pages=gh_repos.total_pages,
        Repository=Repository, active_ids=active_ids,
        repos_type=login+' (organization)'
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号