switching.py 文件源码

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

项目:GridLight-Server 作者: Lunabit 项目源码 文件源码
def push_notify_expired_contracts(expiring_contracts):
    for contract in expiring_contracts:
        try:
            provider_name = Provider.query.filter(Provider.id==Contract.provider_id).one()
        except (NoResultFound, MultipleResultsFound) as e:
            err = "No valid provider associated with contract (id={}).".format(contract.id)
            print_log(err)
            raise InvalidUsage(message=err, status_code=500)

        res = client.send(contract.user.phone_id,
                          "Your contract with \"{}\" is expiring soon!".format(provider_name))

        if res.errors:
            print_log(res.errors)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号