def edit_profile(): form = EditProfileForm() if form.validate_on_submit(): current_user.name = form.name.data current_user.username = form.username.data current_user.bio = form.bio.data current_user.website = form.website.data current_user.location = form.location.data flash('Profile updated.', 'success') return redirect(url_for('.index', username=current_user.username)) form.name.data = current_user.name form.username.data = current_user.username form.bio.data = current_user.bio form.website.data = current_user.website form.location.data = current_user.location return render_template('user/settings/edit_profile.html', form=form)
def edit_profile(): form = EditProfileForm() if form.validate_on_submit(): current_user.name = form.name.data current_user.username = form.username.data current_user.bio = form.bio.data current_user.website = form.website.data current_user.location = form.location.data db.session.commit() flash("Profile updated.", "success") return redirect(url_for("user.index", username=current_user.username)) form.name.data = current_user.name form.username.data = current_user.username form.bio.data = current_user.bio form.website.data = current_user.website form.location.data = current_user.location return render_template("user/settings/edit_profile.html", form=form)
def edit_profile(): """ 编辑信息 """ logger.info('url = ' + str(request.url)) form = EditProfileForm() if form.validate_on_submit(): current_user.name = form.name.data current_user.username = form.username.data current_user.bio = form.bio.data current_user.website = form.website.data current_user.location = form.location.data db.session.commit() flash('Profile updated.', 'success') return redirect(url_for('.index', username=current_user.username)) form.name.data = current_user.name form.username.data = current_user.username form.bio.data = current_user.bio form.website.data = current_user.website form.location.data = current_user.location return render_template('user/settings/edit_profile.html', form=form)