def register_step_2(): ''' Let user edit a simplified version of their profile as part of their registration. ''' form = RegisterStep2Form(obj=current_user) if request.method == 'POST': if form.validate(): form.populate_obj(current_user) db.session.add(current_user) db.session.commit() return redirect(url_for('views.register_step_3')) else: flash(gettext(u'Could not save, please correct errors below')) return render_template('register-step-2.html', form=form)