core.py 文件源码

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

项目:repocribro 作者: MarekSuchanek 项目源码 文件源码
def org_detail(login):
    """Organization detail (GET handler)

    .. todo:: implement 410 (org deleted/archived/renamed)
    """
    db = flask.current_app.container.get('db')
    ext_master = flask.current_app.container.get('ext_master')

    org = db.session.query(Organization).filter_by(login=login).first()
    if org is None:
        user = db.session.query(User).filter_by(login=login).first()
        if user is None:
            flask.abort(404)
        flask.flash('Oy! You wanted to access organization, but it\'s  auser.'
                    'We redirected you but be careful next time!', 'notice')
        return flask.redirect(flask.url_for('core.user_detail', login=login))
    tabs = {}
    ext_master.call('view_core_org_detail_tabs',
                    org=org, tabs_dict=tabs)
    tabs = sorted(tabs.values())
    active_tab = flask.request.args.get('tab', tabs[0].id)

    return flask.render_template(
        'core/org.html', org=org, tabs=tabs, active_tab=active_tab
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号