use form.validate_on_submit() whenever possible
This commit is contained in:
parent
40f8c610d2
commit
aeb4108570
|
@ -34,8 +34,7 @@ def client_detail(client_id):
|
|||
flash("you cannot see this client", "warning")
|
||||
return redirect(url_for("developer.index"))
|
||||
|
||||
if request.method == "POST":
|
||||
if form.validate():
|
||||
if form.validate_on_submit():
|
||||
client.name = form.name.data
|
||||
client.home_url = form.home_url.data
|
||||
|
||||
|
|
|
@ -18,8 +18,7 @@ class NewClientForm(FlaskForm):
|
|||
def new_client():
|
||||
form = NewClientForm()
|
||||
|
||||
if request.method == "POST":
|
||||
if form.validate():
|
||||
if form.validate_on_submit():
|
||||
client = Client.create_new(form.name.data, current_user.id)
|
||||
db.session.commit()
|
||||
|
||||
|
|
Loading…
Reference in a new issue