def register(): next_url = request.args.get('next', url_for('.settings')) form = RegisterForm() if form.validate_on_submit(): user = form.save() login_user(user) return redirect(next_url) return render_template("account/register.html", form=form)
def post(self): form = RegisterForm() if form.validate_on_submit(): user = form.save() return jsonify( msg="Registered user", user=user.to_dict() ) return jsonify( error=form.errors.values()[0] )