views.py 文件源码

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

项目:WunderHabit 作者: passuf 项目源码 文件源码
def check_webhooks(request):
    user = request.user

    if not hasattr(user, 'wunderlist'):
        return render(request, 'wunderlist/check_webhooks.html')

    api = WunderlistApi(user.wunderlist.api_token)
    lists = api.get_lists()

    if lists is None:
        messages.error(request, _('Could not get lists from Wunderlist. Please try to reconnect.'))
        return redirect('index')

    webhooks = []
    for l in lists:
        webhooks.extend(api.get_webhooks(l[default.JSON_ID]))

    return render(request, 'wunderlist/check_webhooks.html', {'lists': lists, 'webhooks': webhooks})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号