#30376: Saving ModelForm with missing, non-optional fields does not trigger a
validation error
-------------------------------+--------------------------------------
     Reporter:  Will Gordon    |                    Owner:  nobody
         Type:  Bug            |                   Status:  closed
    Component:  Documentation  |                  Version:  master
     Severity:  Normal         |               Resolution:  invalid
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => invalid
 * version:  2.1 => master
 * component:  Uncategorized => Documentation


Comment:

 `ModelForm` doesn't take into account missing fields in both `clean()` and
 `save()` method, IMO it is expected behavior, see e.g.

 {{{
 Any fields not included in a form by the above logic will not be set by
 the form’s save() method.
 }}}

 `blank=True` is not related with a DB constraint (like e.g. `null=False`)
 that's why `IntegrityError` is also not raised by a DB.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30376#comment:3>
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/067.6ccfdff9ab7318ba43425ca489633cb1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to