AuthUtil.py 文件源码

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

项目:git-webhook 作者: NetEaseGame 项目源码 文件源码
def has_auth_webhooks(user_id):
    """??????????Webhooks"""
    # create webhooks
    created_webhooks = WebHook.query.filter_by(
        user_id=user_id, deleted=False).all()

    # collaborator webhooks
    collaborated_webhooks = \
        WebHook.query.join(Collaborator,
                           Collaborator.webhook_id == WebHook.id) \
                     .filter(Collaborator.user_id == user_id) \
                     .filter(WebHook.deleted == false()).all()

    webhooks = created_webhooks + collaborated_webhooks
    # ?????
    webhooks = list(sorted(set(webhooks), key=lambda x: x.id, reverse=True))
    return webhooks
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号