コード例 #1
0
ファイル: blog.py プロジェクト: radjah/point-www
def subscribe(id):
    try:
        posts.subscribe(id)
    except AlreadySubscribed:
        raise Forbidden

    if env.request.is_xhr:
        return Response(json.dumps({'ok': True}), mimetype='application/json')

    return Response(redirect=env.request.referer)
コード例 #2
0
def subscribe(id):
    try:
        posts.subscribe(id)
    except AlreadySubscribed:
        raise Forbidden

    if env.request.is_xhr:
        return Response(json.dumps({'ok': True}), mimetype='application/json')

    return Response(redirect=env.request.referer)
コード例 #3
0
ファイル: posts.py プロジェクト: skobkin/point
def subscribe(post_id):
    try:
        post = posts.subscribe(post_id)
        cnt = post.comments_count()
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except (PostAuthorError, SubscribeError):
        return xmpp_template('post_denied', post_id=post_id)
    except AlreadySubscribed:
        return xmpp_template('post_sub_already', post_id=post_id)
    return xmpp_template('post_sub_ok', post_id=post_id, comments=cnt)
コード例 #4
0
ファイル: posts.py プロジェクト: hirthwork/point-xmpp
def subscribe(post_id):
    try:
        post = posts.subscribe(post_id)
        cnt = post.comments_count()
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except (PostAuthorError, SubscribeError):
        return xmpp_template('post_denied', post_id=post_id)
    except AlreadySubscribed:
        return xmpp_template('post_sub_already', post_id=post_id)
    return xmpp_template('post_sub_ok', post_id=post_id, comments=cnt)
コード例 #5
0
ファイル: blog.py プロジェクト: kainwinterheart/point-www
def subscribe(id):
    posts.subscribe(id)
コード例 #6
0
ファイル: blog.py プロジェクト: skobkin/point
def subscribe(id):
    posts.subscribe(id)