-
Notifications
You must be signed in to change notification settings - Fork 27
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
Wrong foreign key field pass the validation if the field is optional #46
Comments
"It happens" -- what happens? Can you clarify? What are you wanting to happen? |
Happens that form.validate() returns True and then on saving the object, I get database error because foreign key constraint fails. |
I have another issue with this |
Hmm... As I recall the way wtforms manages field data and handles validation was really weird and I had to make many workarounds. Not sure? Can you create a failing test-case in the test-suite? |
Yes, sure. |
It happens because get_model doesn't fail on DoesNotExist https://github.com/coleifer/wtf-peewee/blob/master/wtfpeewee/fields.py#L229
Could you please change this behavior?
The text was updated successfully, but these errors were encountered: