GrLdev / Rate-My-Student-Home

A website designed to allow students rate their student homes in Cardiff.
3 stars 0 forks source link

Validation errors should use WTForm's native error system #97

Open theobaur13 opened 1 year ago

theobaur13 commented 1 year ago

Currently the CreateReviewForm creates an error list, then on submit clears the list and adds the validation error to the list for it to be displayed: image image However, WTForms have a native error dict, I have managed to get it working when validating individual fields, the following example would work:

def validate_name(self, name):
  raise ValidationError("error")

I am yet to figure out how to do the same with the validate(self) method

moahmed0987 commented 10 months ago

i think i know how to do this, will give it a go