GrLdev / GrLdev/Rate-My-Student-Home

Validation errors should use WTForm's native error system

Open
#97 1 comment 0 reactions 1 assignee Claimed by @moahmed0987 View on GitHub
nice to have
Dominant language
Python
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/GrLdev/Rate-My-Student-Home/assets/72320294/f411eade-095f-4d7a-92f5-f42dc010bf59)
![image](https://github.com/GrLdev/Rate-My-Student-Home/assets/72320294/429fbc24-74f1-4dca-addb-673e9b1687c7)
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.