2👍
✅
Because form_valid
isn’t getting called, it means that the issue isn’t that your form isn’t saving, it’s that the data you’re passing to the form isn’t passing validation. Take a look here at the docs.
To debug the issue, start by putting a form_invalid()
method in your view or a custom clean()
method in your form, and see why the form isn’t validating. I.e., check out the errors in the form instance and see what that shows you. That should answer your question.
There are also some methods you’re calling that may or may not be making the form invalid before it’s even instantiated. I’m not sure what the set_company
method does on a field but it may have an error whereby your form isn’t getting setup properly.
Source:stackexchange.com