Hiii,
Here is how you can see what the hidden errors are. Above your form class, add these imports:
# get a way to log the errors:
import logging
log = logging.getLogger(__name__)
# convert the errors to text
from django.utils.encoding import force_text
Then add to your form class this def:
class MyAdminForm(forms.ModelForm):
def is_valid(self):
log.info(force_text(self.errors))
return super(MyAdminForm, self).is_valid()
When you examine your log after submitting again, it will list all the hidden errors.
When I had this problem, I found the cause of the errors were some 'calculated' read-only fields that I had added to the form, e.g.:
get_num_items = forms.IntegerField()
The validation failed since these fields had no value as required. Changing the field definition to include required=False fixed the problem:
get_num_items = forms.IntegerField(required=False)
Hope this works!!
Thank You!!