def api_delete_comments(request, *, comment_id):
'''delete comment.'''
check_admin(request)
comment = yield from Comment.find(comment_id)
if comment is None:
raise APIResourceNotFoundError('Comment', 'can not find comment, comment id: {}'.format(comment_id))
yield from comment.remove()
return comment
评论列表
文章目录