New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve ModelField errors #2075
Improve ModelField errors #2075
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
|
||
def pre_validate(self, form): | ||
# If any error happen during process, we raise StopValidation here | ||
# to prevent "DataRequired" validator from clearing errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that was the tricky part to find !!! 😅
It took a day to write But I just discovered some existing tests in WTForm error handling is a little bit tricky: the |
Done, tests passed |
This PR test and fixes some error cases on
ModelField
form field withdb.ReferenceField
anddb.GenericReferenceField
:Fix #2066