[Answer]-Django Fomset is_valid() fails with no errors

0๐Ÿ‘

โœ…

So, I was missing a

 return self

in the form validation, as told from Raunak Agarwal, and I was using an incorrect method for returning errors as told from Mark Lavin.

But over to all is that

 if (bearing != None) or (bearing < 0) or (bearing > 360):

is returning always False. This is the correct condition:

 if (bearing == None) or (bearing < 0) or (bearing > 360):

Thanks to all!

๐Ÿ‘คMarco Fedele

1๐Ÿ‘

You are missing return cleaned_data

๐Ÿ‘คRaunak Agarwal

Leave a comment