Exemplo n.º 1
0
def subscribe():
    vkid = request.form.get(VKID_NAME, None)
    target_id = request.form.get("target_id", None)
    if vkid and target_id:
        if subscribe_on_target_person(owner_id=target_id, follower_id=vkid):
            return json.dumps({"success": 1})
        else:
            return json.dumps({
                "success": 0,
                "message": "User with id='{0}' does not exist".format(target_id)
            })
Exemplo n.º 2
0
def subscribe():
    vkid = request.form.get(VKID_NAME, None)
    target_id = request.form.get("target_id", None)
    if vkid and target_id:
        if subscribe_on_target_person(owner_id=target_id, follower_id=vkid):
            return json.dumps({"success": 1})
        else:
            return json.dumps({
                "success":
                0,
                "message":
                "User with id='{0}' does not exist".format(target_id)
            })
Exemplo n.º 3
0
def sub(owner, follower):
    if owner and follower and subscribe_on_target_person(owner_id=owner,
                                                         follower_id=follower):
        logger.info(u"OK")
    else:
        logger.info(u"Failed")