示例#1
0
def delete():
    if not session.get('name', None):
        return redirect('/login')
    id = request.args.get('id')
    try:
        user_db.delete(id)
        return redirect('/userlist')
    except:
        errmsg = 'delete user failed'
        print traceback.print_exc()
        return render_template("userlist.html", result=errmsg)
示例#2
0
def delete():
    if not session.get('username',None):
        return redirect('/login')
    id = request.args.get('id')
    table = 'users'
    try:
        user_db.delete(id,table)
	return json.dumps({'code':0, 'result':'delete user success'})
    except:
        print traceback.print_exc()
	return json.dumps({'code':1, 'result':'delete user failed'})
示例#3
0
def delete():
    if not session.get('name',None):
	return redirect('/login')
    id = request.args.get('id')
    try:
	user_db.delete(id)
	return redirect('/userlist')
    except:
	errmsg = 'delete user failed'
	print traceback.print_exc()
	return render_template("userlist.html", result = errmsg)