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})
评论列表
文章目录