Calling ModelForm.clean() is no longer optional
|Reported by:||Carl Meyer||Owned by:||Carl Meyer|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
It's documented http://docs.djangoproject.com/en/1.1/topics/forms/modelforms/#overriding-the-clean-method? that if you override clean() on a ModelForm and fail to call ModelForm's clean() method, all you lose is validate_unique. With the recent model validation changes, this is no longer true; ModelForm.clean does quite a bit more (including constructing self.instance), and failing to call it will almost certainly break things.
Per discussion with jkocherhans in IRC, it should be possible to rearrange things to maintain the previously documented behavior.
Change History (8)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
|Status:||new → assigned|