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)
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'})
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)