#15587: django.forms.BaseModelForm._post_clean updates instance even when form validation fails ------------------------------------+--------------------------------- Reporter: lanyjie | Owner: nobody Type: Bug | Status: reopened Milestone: | Component: Forms Version: 1.3 | Severity: Normal Resolution: | Keywords: data validation Triage Stage: Accepted | Has patch: 0 Needs documentation: 1 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | ------------------------------------+--------------------------------- Changes (by bpeschier):
* needs_docs: 0 => 1 * stage: Unreviewed => Accepted Comment: The question here is at which point the form is allowed to update the instance. Other tickets are also having problems here for their own reasons (#15995, #16423). There is a strong argument for doing this while validating since !ModelForm actually promises to fully validate the data (form **and** model). For this the instance needs to be updated. However, there is case for reminding people that in current workflow validation implies updating the model to independently validate the model; so if anybody can create a patch for the docs explaining this. Otherwise this will become a DDN and we need to discuss whether a form validation error means the field should not be updated on the model. -- Ticket URL: <https://code.djangoproject.com/ticket/15587#comment:5> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.