Ejemplo n.º 1
0
def delete():
	if not session.get('name',None):
                return redirect('/login')
	id = request.args.get('id',None)
        if not id:
                errmsg="must have id"
                return render_template("userlist.html",result=errmsg)
        try:
		del_user(id)        
		return redirect('/userlist')
        except:
                errmsg="delete failed"
                return render_template("userlist.html",result=errmsg)
Ejemplo n.º 2
0
def delete():
    if not session.get('name', None):
        return redirect('/login')
    id = request.args.get('id', None)
    if not id:
        errmsg = "must have id"
        return render_template("userlist.html", result=errmsg)
    try:
        del_user(id)
        return redirect('/userlist')
    except:
        errmsg = "delete failed"
        return render_template("userlist.html", result=errmsg)
Ejemplo n.º 3
0
def delete(rfid):
    if valid_rfid(rfid):
        if userdb.del_user(get_conn(), encode_rfid(rfid)):
            print "fob deleted"
        else:
            print "fob not in the system"
    else:
        print "bad fob code {0}".format(rfid)
Ejemplo n.º 4
0
def delete(rfid):
    if valid_rfid(rfid):
        if userdb.del_user(get_conn(), encode_rfid(rfid)):
            print "fob deleted"
        else:
            print "fob not in the system"
    else:
        print "bad fob code {0}".format(rfid)
Ejemplo n.º 5
0
def deluser():
    flash('删除用户成功')
    delid = request.form.get('userid')

    user.del_user(delid)  #通过user.del_user函数调用sql删掉得到的用户
    return redirect('/users/')