def new(request): """The new-question form.""" form = QuestionForm() if request.method == 'POST' and form.validate(): topic = form.create_topic() session.commit() request.flash(_(u'Your question was posted.')) return redirect(url_for(topic)) return render_template('kb/new.html', form=form.as_widget())