Model validation: full_clean() should call clean() before clean_fields()
|Reported by:||ludovicofischer||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.2|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If a model field is marked as blank=False, a possibility is to override Model.clean() to set the field to a default value. Unfortunately, Model.full_clean() will still throw an exception, because the exception will be generated by Model.clean_fields() before clean() has a chance to run. This patch interchanges the execution order so as to make clean() run before clean_fields().