def user_profile_page(): form = UserProfileForm(request.form, current_user) if request.method == 'POST' and form.validate(): form.populate_obj(current_user) db.session.commit() flash(word('Your information was saved.'), 'success') return redirect(url_for('index')) return render_template('users/user_profile_page.html', form=form, debug=debug_status())
def user_profile_page(): form = UserProfileForm(request.form, current_user) if request.method == "POST" and form.validate(): form.populate_obj(current_user) db.session.commit() flash(word("Your information was saved."), "success") return redirect(url_for("index")) return render_template("users/user_profile_page.html", form=form)
def user_profile_page(): the_tz = (current_user.timezone if current_user.timezone else get_default_timezone()) form = UserProfileForm(request.form, obj=current_user) form.timezone.choices = [ (x, x) for x in sorted([tz for tz in pytz.all_timezones]) ] form.timezone.default = the_tz if str(form.timezone.data) == 'None': form.timezone.data = the_tz if request.method == 'POST' and form.validate(): form.populate_obj(current_user) db.session.commit() flash(word('Your information was saved.'), 'success') return redirect(url_for('interview_list')) return render_template('users/user_profile_page.html', page_title=word('User Profile'), tab_title=word('User Profile'), form=form, debug=debug_status())