[Answered ]-Django custom form – cleaned_data has incorrect values for IntegerField

1👍

In your form definition you have

year_from = forms.IntegerField(required=False, disabled=True,

From the docs

The disabled boolean argument, when set to True, disables a form field
using the disabled HTML attribute so that it won’t be editable by
users. Even if a user tampers with the field’s value submitted to the
server, it will be ignored in favor of the value from the form’s
initial data.

If you want users to be able to edit the value, removing this attribute should do the trick.

Leave a comment