예제 #1
0
파일: views.py 프로젝트: pwilkins/nbproject
def editNote(payload, req): 
    uid = UR.getUserId(req)
    if not auth.canEdit(uid,  payload["id_comment"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    else:
        annotations.editNote(payload)
    #no need to worry about threadmarks: they can't be changed from an "edit-mode" editor        
    return UR.prepare_response({"comments":  annotations.getComment(payload["id_comment"], uid)})
예제 #2
0
def editNote(payload, req): 
    uid = UR.getUserId(req)
    if not auth.canEdit(uid,  payload["id_comment"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    else:
        annotations.editNote(payload)
    #no need to worry about threadmarks: they can't be changed from an "edit-mode" editor        
    return UR.prepare_response({"comments":  annotations.getComment(payload["id_comment"], uid)})
예제 #3
0
def editNote(payload, req): 
    uid = UR.getUserId(req)
    if not auth.canEdit(uid,  payload["id_comment"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    else:
        annotations.editNote(payload)
        #for mark in payload["marks"]:
        #    annotations.markNote(uid, {"action": payload["marks"][mark], "id_comment": payload["id_comment"]})
        return UR.prepare_response({"comments":  annotations.getComment(payload["id_comment"], uid), 
                   "marks": annotations.getMark(uid,{"id_comment":  payload["id_comment"]}) 
                   })
예제 #4
0
def editNote(payload, req):
    uid = UR.getUserId(req)
    if not auth.canEdit(uid, payload["id_comment"]):
        return UR.prepare_response({}, 1, "NOT ALLOWED")
    else:
        annotations.editNote(payload)
        #for mark in payload["marks"]:
        #    annotations.markNote(uid, {"action": payload["marks"][mark], "id_comment": payload["id_comment"]})
        return UR.prepare_response({
            "comments":
            annotations.getComment(payload["id_comment"], uid),
            "marks":
            annotations.getMark(uid, {"id_comment": payload["id_comment"]})
        })
예제 #5
0
def editNote(payload, req):
    uid = UR.getUserId(req)
    if not auth.canEdit(uid,  payload["id_comment"]):
        return UR.prepare_response({}, 1,  "NOT ALLOWED")
    else:
        edited_loc = annotations.editNote(payload)
    tags = {}
    tags.update(annotations.getTagsByComment(payload["id_comment"]))
    #no need to worry about threadmarks: they can't be changed from an "edit-mode" editor
    retval = {"comments":  [annotations.getComment(payload["id_comment"], uid)], "tags": tags, "cid": payload["id_comment"]}
    if not edited_loc == None:
        retval["edit_location"] = edited_loc
    return UR.prepare_response(retval)
예제 #6
0
파일: views.py 프로젝트: papain/nbproject
def editNote(payload, req):
    uid = UR.getUserId(req)
    if not auth.canEdit(uid, payload["id_comment"]):
        return UR.prepare_response({}, 1, "NOT ALLOWED")
    else:
        edited_loc = annotations.editNote(payload)
    tags = {}
    tags.update(annotations.getTagsByComment(payload["id_comment"]))
    #no need to worry about threadmarks: they can't be changed from an "edit-mode" editor
    retval = {
        "comments": [annotations.getComment(payload["id_comment"], uid)],
        "tags": tags,
        "cid": payload["id_comment"]
    }
    if not edited_loc == None:
        retval["edit_location"] = edited_loc
    return UR.prepare_response(retval)