simplified more form stuff

This commit is contained in:
Kyle Roux 2017-05-16 11:23:43 -07:00
parent 19abb0749d
commit a722f42678

9
app.py
View File

@ -28,14 +28,9 @@ def new_contact():
'''
form = ContactForm()
if form.validate_on_submit():
# Get form
name = form.name.data
surname = form.surname.data
email = form.email.data
phone = form.phone.data
# Save in database
try:
my_contact = Contact(name, surname, email, phone)
my_contact = Contact()
form.populate_obj(my_contact)
db.session.add(my_contact)
db.session.commit()
# User info