Monday, December 31, 2018

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

I think the behavior changed in https://github.com/django/django/commit/5fa4f40f45fcdbb7e48489ed3039a314b5c961d0.

The old behavior looks like a bug to me (can you explain why it would be expected?) and we don't generally document bug fixes in the release notes.

On Monday, December 31, 2018 at 8:24:49 AM UTC-5, Franc Boekelo wrote:
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/b23647bb-6675-4fc7-8917-9d3f61a5a88a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment