pjwalen / argumentum

A platform for arguments.
1 stars 0 forks source link

Display form validation errors. #16

Open pjwalen opened 6 years ago

pjwalen commented 6 years ago

Setup a 'flask.flash' call in our base template so we can report form validation errors. (check this out as an example http://flask.pocoo.org/snippets/12/)

  1. If someone submits bad data in a form, wtforms will create a form.errors variable, we need to display the data from this variable to an end-user when the page is loaded, after a bad submission. (You can test this by submitting a form with blank data)
  2. Use the flask.flash function to send this data to the subsequent http request after a bad form submission
  3. Use the base template (base.html) to detect incoming flask.flash data and display it back to the user with a bootstrap alert box that is either displayed momentarily or is close-able.
  4. If possible, write a test case to check for this output