Esempio n. 1
0
def unsubscribe(id):
    posts.unsubscribe(id)

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

    return Response(redirect=env.request.referer)
Esempio n. 2
0
def unsubscribe(id):
    posts.unsubscribe(id)

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

    return Response(redirect=env.request.referer)
Esempio n. 3
0
def unsubscribe(post_id):
    try:
        posts.unsubscribe(post_id)
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except PostAuthorError:
        return xmpp_template('post_denied', post_id=post_id)
    return xmpp_template('post_unsub_ok', post_id=post_id)
Esempio n. 4
0
def unsubscribe(post_id):
    try:
        posts.unsubscribe(post_id)
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except PostAuthorError:
        return xmpp_template('post_denied', post_id=post_id)
    return xmpp_template('post_unsub_ok', post_id=post_id)
Esempio n. 5
0
def unsubscribe(post_id):
    """Unsubscribe from certain post. 
    If user is not subscribed to this post, return "You are not subscribed 
    to #post_id", else return "You've sucessfully unsubscribed..."
    """
    try:
        if posts.check_subscribe_to(post_id):
            posts.unsubscribe(post_id)
            return xmpp_template('post_unsub_ok', post_id=post_id)
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except PostAuthorError:
        return xmpp_template('post_denied', post_id=post_id)
    return xmpp_template('post_not_subscribed', post_id=post_id)
Esempio n. 6
0
def unsubscribe(post_id):
    """Unsubscribe from certain post. 
    If user is not subscribed to this post, return "You are not subscribed 
    to #post_id", else return "You've sucessfully unsubscribed..."
    """
    try:
        if posts.check_subscribe_to(post_id):
            posts.unsubscribe(post_id)
            return xmpp_template('post_unsub_ok', post_id=post_id)
    except PostNotFound:
        return xmpp_template('post_not_found', post_id=post_id)
    except PostAuthorError:
        return xmpp_template('post_denied', post_id=post_id)
    return xmpp_template('post_not_subscribed', post_id=post_id)
Esempio n. 7
0
def unsubscribe(id):
    posts.unsubscribe(id)
Esempio n. 8
0
def unsubscribe(id):
    posts.unsubscribe(id)