Monday, December 31, 2018

Form no longer validates after upgrading django from 2.0.5 to 2.1. Should I report a bug?

Hello,

In our project we have a Model with this field:

    has_drivers_license = models.BooleanField(verbose_name=_('Heeft rijbewijs'), default=False, choices=BOOL_CHOICES)

and we have a ModelForm, where this field is used:

    fields = [... 'has_drivers_license', ]

and we use a radio select widget:

    widgets = {
'has_drivers_license': forms.RadioSelect
}

Now, in one specific template where we use this form, we don't include this specific field. In the view, the form would validate anyway. After upgrading to django 2.1  (from 2.0.5), this form no longer validates, saying that has_drivers_license is required. 
I have now added "blank = True" to the Model field, after which the form validates again.

Should I report a bug? I didn't see anything in the release notes that would lead to me to expect backward incompatible behavior on this issue.

Thanks! 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e64a1e2a-7169-42a5-8ea2-a3bfd609ec88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment