Beispiel #1
0
def addcard(tuid):
    lib = LibManager()
    user = UserManager()
    uid = session["uid"]
    result = "false"
    if user.hasUid(tuid) and not lib.hasCard(uid, tuid):
        if lib.addCard(uid, tuid):
            result = "true"
    return result
Beispiel #2
0
def delcard(tuid):
    lib = LibManager()
    user = UserManager()
    uid = session["uid"]

    result = "false"
    if user.hasUid(tuid) and lib.hasCard(uid, tuid):
        if lib.deleteCard(uid, tuid):
            result = "true"
    return result