def users_update(): if request.method == 'POST': user_data = request.form.to_dict() db.user_update(user_data) return redirect('/users/') id = request.args.get('id') user = db.get_user_by_id(id) return render_template('user_modify.html', user=user)
def users_update(): if request.method == 'POST': user_data = request.form.to_dict() db.user_update(user_data) return json.dumps({"status":0, "msg":"update success!"}) # return redirect('/users/') id = request.args.get('id') user = db.get_user_by_id(id) return render_template('user_modify.html', user=user, session={'user': session.get('username')})
def users_update(): if request.method == 'POST': user_data = request.form.to_dict() db.user_update(user_data) return json.dumps({"status":0, "msg":"update success!"}) # return redirect('/users/') id = request.args.get('id') user = db.get_user_by_id(id) return render_template('user_modify.html', user=user, session={'user': session.get('username')})
def users_update(): params = request.form password = params.get('password') name_cn = params.get('name_cn') email = params.get('email') mobile = params.get('mobile') role = params.get('role') status = params.get('status') db.user_update(password,name_cn,email,mobile,role,status) return redirect('/users/')
def users_update(): params = request.form password = params.get('password') name_cn = params.get('name_cn') email = params.get('email') mobile = params.get('mobile') role = params.get('role') status = params.get('status') db.user_update(password, name_cn, email, mobile, role, status) return redirect('/users/')
def users_update(): if request.method == 'GET': id = request.args.get('id') user = db.get_user_by_id(id) user.pop('create_time') user.pop('last_time') return json.dumps(dict(user)) else: userinfo = request.form.to_dict() data = db.user_update(userinfo['name'], userinfo) return json.dumps(data)
def users_update(): if request.method == 'GET': id = request.args.get('id') user = db.get_user_by_id(id) user.pop('create_time') user.pop('last_time') return json.dumps(dict(user)) else: userinfo = request.form.to_dict() data = db.user_update(userinfo['name'], userinfo) util.WriteLog('infoLogger').info('%s changed userinfo %s' % (session['username'], userinfo['name'])) return json.dumps(data)
def users_update(): if request.method == 'GET': id = request.args.get('id') user = db.get_user_by_id(id) user.pop('create_time') user.pop('last_time') return json.dumps(dict(user)) else: userinfo = request.form.to_dict() data = db.user_update(userinfo['name'], userinfo) util.WriteLog('infoLogger').info( '%s changed userinfo %s' % (session['username'], userinfo['name'])) return json.dumps(data)
def user_edit_profile(member, new_email=None, new_mobile=None): if new_email is not None: member['email'] = new_email if new_mobile is not None: member['mobile'] = new_mobile return db.user_update(member)
def user_change_password(member, new_password): member['passwd'] = new_password return db.user_update(member)