示例#1
0
def delete_comment(post_id, comment_id):
    try:
        posts.delete_comment(post_id, comment_id)
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except CommentNotFound:
        return xmpp_template('comment_not_found', post_id=post_id,
                                                  comment_id=comment_id)
    except CommentAuthorError:
        return xmpp_template('comment_del_denied', post_id=post_id,
                                                   comment_id=comment_id)
    return xmpp_template('comment_del', post_id=post_id,
                                        comment_id=comment_id)
示例#2
0
文件: posts.py 项目: skobkin/point
def delete_comment(post_id, comment_id):
    try:
        posts.delete_comment(post_id, comment_id)
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except CommentNotFound:
        return xmpp_template('comment_not_found',
                             post_id=post_id,
                             comment_id=comment_id)
    except CommentAuthorError:
        return xmpp_template('comment_del_denied',
                             post_id=post_id,
                             comment_id=comment_id)
    return xmpp_template('comment_del', post_id=post_id, comment_id=comment_id)
示例#3
0
文件: blog.py 项目: radjah/point-www
def delete(id):
    comment_id = env.request.args('comment_id')
    try:
        if comment_id:
            post = posts.delete_comment(id, comment_id)
            if env.owner:
                login = post.author.login.lower()
            else:
                post = Post(id)
                login = post.author.login.lower()

            return Response(redirect='%s://%s.%s/%s' % \
                            (env.request.protocol, login, settings.domain, id))
        else:
            posts.delete_post(id)
            return Response(redirect='%s://%s.%s/blog' % \
               (env.request.protocol, env.user.login.lower(), settings.domain))
    except PostAuthorError:
        raise SubscribeError
示例#4
0
def delete(id):
    comment_id = env.request.args('comment_id')
    try:
        if comment_id:
            post = posts.delete_comment(id, comment_id)
            if env.owner:
                login = post.author.login.lower()
            else:
                post = Post(id)
                login = post.author.login.lower()

            return Response(redirect='%s://%s.%s/%s' % \
                            (env.request.protocol, login, settings.domain, id))
        else:
            posts.delete_post(id)
            return Response(redirect='%s://%s.%s/blog' % \
               (env.request.protocol, env.user.login.lower(), settings.domain))
    except PostAuthorError:
        raise SubscribeError
示例#5
0
def delete_comment(id, comment_id):
    try:
        posts.delete_comment(id, comment_id)

    except PostAuthorError:
        raise SubscribeError
示例#6
0
文件: blog.py 项目: skobkin/point
def delete_comment(id, comment_id):
    try:
        posts.delete_comment(id, comment_id)

    except PostAuthorError:
        raise SubscribeError