app.py 文件源码

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

项目:toshi-admin-service 作者: toshiapp 项目源码 文件源码
def get_config_home(request, current_user):
    # get list of admins
    async with app.pool.acquire() as con:
        admins = await con.fetch("SELECT * FROM admins")
    users = []
    for admin in admins:
        async with app.configs['mainnet'].db.id.acquire() as con:
            user = await con.fetchrow("SELECT * FROM users WHERE toshi_id = $1", admin['toshi_id'])
        if user is None:
            user = {'toshi_id': admin['toshi_id']}
        users.append(fix_avatar_for_user(app.configs['mainnet'].urls.id, dict(user)))
    return html(await env.get_template("config.html").render_async(
        admins=users,
        current_user=current_user, environment='config', page="home"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号