def profile(): form = UserProfileForm(obj=current_user) if form.validate_on_submit(): form.updated_profile(current_user) flash('个人信息更新成功', 'success') return redirect(url_for('front.index')) return render_template('user/profile.html', form=form)
def profile(): form = UserProfileForm(obj=current_user) if form.validate_on_submit(): form.updated_profile(current_user) flash('信息更新成功', 'success') return redirect(url_for('user.user_detail')) return render_template('user/userprofile.html',form=form)
def user_profile(): form = UserProfileForm(obj=current_user) if form.validate_on_submit(): form.update_user(current_user) flash('更新用户信息成功', 'success') return redirect(url_for('user.user_profile')) return render_template('profile.html', form=form)
def profile(): form = UserProfileForm(obj=current_user) if form.validate_on_submit(): form.update_profile(current_user) flash('update done','success') return redirect(url_for('front.index')) return render_template('user/profile.html',form=form)
def profile(): form = UserProfileForm(obj=current_user) if form.validate_on_submit(): form.update_user(current_user) return redirect(url_for("user.profile")) return render_template("user/profile.html", form=form)
def user_profile(): user = User.query.filter_by(id=current_user.id).first() form = UserProfileForm(obj=user, id=user.id) if form.validate_on_submit(): form.Profile_update(user) flash('您的个人资料修改成功!', 'success') return redirect(url_for('front.index')) return render_template('user/profile.html', form=form, user=user)
def edituser(user_id): user = User.query.get_or_404(user_id) form = UserProfileForm(obj=user, id=user.id) if form.validate_on_submit(): form.Profile_update(user) flash('用户信息更新成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/edit_user.html', form=form, user=user)
def userprofile(): user = current_user form = UserProfileForm(obj=current_user) if form.validate_on_submit(): form.update_user(current_user) flash('个人信息更新成功', 'success') return redirect(url_for('user.home_page', user_id=user.id)) return render_template('user/userprofile.html', form=form)
def profile(): """ 个人信息配置 """ form = UserProfileForm(obj=current_user) if form.validate_on_submit(): form.updated_profile(current_user) flash("个人信息更新成功", "success") return redirect(url_for("front.index")) return render_template("user/profile.html", form=form)
def profile(): form = UserProfileForm(current_user, obj=current_user) if form.validate_on_submit(): #if not form.password.data: # current_user.password = form.user.password form.update_profile(current_user) #db.session.add(current_user) #db.session.commit() flash('个人信息更新成功','success') return redirect(url_for('front.index')) return render_template('user/profile.html',form=form)
def profile(): form = UserProfileForm(obj=current_user) #UserProfileForm 传入一个User对象,Form中显示相应数据 #login_user后,创建了current_user,是一个User对象 if form.validate_on_submit(): form.updata_profile(current_user) #form.updata_profile,传入一个User对象,修改参数,上传给数据库 flash('个人信息更新成功','success') return redirect(url_for('front.index')) return render_template('user/profile.html',form=form)
def user_profile(): user = User.query.filter_by(id=current_user.id).first() form = UserProfileForm(obj=user, id=user.id) if form.validate_on_submit(): file = form.upload_resume_file.data if file: filename = secure_filename(file.filename) file.save(os.path.join('jobplus/static/', 'resume', filename)) user.upload_resume_jobname = filename db.session.add(user) db.session.commit() print(filename) form.Profile_update(user) flash('您的个人资料修改成功!', 'success') return redirect(url_for('front.index')) return render_template('user/profile.html', form=form, user=user)
def profile(): form = UserProfileForm(obj=current_user) action = 'user.profile' title = '编辑个人信息' if form.validate_on_submit(): form.update_profile(current_user) flash('个人信息更新成功', 'success') return redirect(url_for('user.profile')) return render_template('justform.html', form=form, action=action, title=title, upload=True)
def edit_user(user_id): user = User.query.get_or_404(user_id) if user.is_company: form = CompanyProfileForm(obj=user) else: form = UserProfileForm(obj=user) if form.validate_on_submit(): form.updated_profile(user) flash('更新成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/edit_user.html', form=form, user=user)
def profile(): form = UserProfileForm(obj=current_user) if form.validate_on_submit(): set_resume.save(form.resume.data, name=form.name_resume()) form.updated_profile(current_user) flash('个人信息更新成功', 'success') return redirect(url_for('front.index')) return render_template('user/profile.html', form=form)
def edit_user(): """ 更新用户 """ user_id = request.args.get("user_id", "") user = User.query.get_or_404(user_id) if not user.is_admin: if user.is_company: company = Company.query.filter(Company.user == user).first() company.name = user.username company.email = user.email form = CompanyProfileForm(obj=company) if user.is_everyone: form = UserProfileForm(obj=user) if form.validate_on_submit(): form.updated_profile(user) flash("信息更新成功", "success") return redirect(url_for("admin.manage_user")) return render_template("admin/edit_user.html", form=form, user=user)
def user_profile(): form = UserProfileForm() return render_template('user/profile.html', form=form)