예제 #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