Opened 9 years ago
Closed 9 years ago
#22530 closed Cleanup/optimization (invalid)
Improve "The XYZ could not be created because the data didn't validate."
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When saving a form, I get this error message. It tells me which model is not correct and that it couldn't be created. But it gives me no clue what data is wrong. What is data, what is data expected to be. Which attribute is wrong.
Note: See
TracTickets for help on using
tickets.
You should check
form.is_valid()
before trying to save the form. If it returns False, then you can accessform.errors
to figure out which fields didn't validate. You can read more about how to use forms here: https://docs.djangoproject.com/en/dev/topics/forms/