#12596: Calling ModelForm.clean() is no longer optional
---------------------------------+------------------------------------------
Reporter: carljm | Owner: carljm
Status: assigned | Milestone:
Component: Forms | Version: 1.1
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
Changes (by carljm):
* has_patch: 0 => 1
Comment:
Comments on the patch:
- I removed the documentation about validate_unique happening in
ModelForm.clean, as that is no longer the case.
- Is it necessary to document the existence of ModelForm.clean_instance?
- There's some extra rigmarole necessary at the beginning and end of
ModelForm.clean_instance to re-add an empty self.cleaned_data if
Form.full_clean removed it, and re-remove it if there are errors when
done. These extra lines could be removed if we just move the last two
lines of Form.full_clean (the removal of cleaned_data if there are errors)
into Form._get_errors; but jkocherhans notes that might surprise people
who overrode full_clean in order to modify or get rid of the cleaned_data
removal.
--
Ticket URL: <
http://code.djangoproject.com/ticket/12596#comment:2>