@app.route("/register", methods=["GET", "POST"])
def register():
form = Form()
if form.validate_on_submit():
pass
return render_template("register.html", form=form)
In the above code first there comes the if statement and then the form is returned. So after returning the render_template("register.html", form=form)
how does the if statement still validates the form?
whereas after return statement is executed the function should stop running.