#27383: Regression: `FileField(default=None)` now never upload a file through a
ModelForm
--------------------------------------+--------------------
Reporter: Maxime Lorant | Owner: nobody
Type: Bug | Status: new
Component: File uploads/storage | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
We had in our code the following line (don't ask why, I don't know):
{{{
class SomeModel(models.Model):
foo = ...
bar = ...
file = models.FileField(null=True, blank=True, default=None)
class SomeModelForm(forms.ModelForm):
class Meta:
fields = ('foo', 'bar', 'file', )
}}}
It was working until Django 1.9.x, but switching to Django 1.10,
submission of files through a ModelForm stopped working. I found a
solution by removing the useless `default=None`. Even though its
usefulness can be questioned, it looks like it is a regression not
documented in the release notes.
Should we bother adding it or fix it?
--
Ticket URL: <https://code.djangoproject.com/ticket/27383>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.860eb393457945500beb5e0d957bb2ce%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.