#22921: Model.clean_fields incorrectly skips validation for fields where null 
value
is not allowed
-------------------------------------+-------------------------------------
     Reporter:  silveroff@…          |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |                  Version:  master
    Component:  Database layer       |               Resolution:
  (models, ORM)                      |             Triage Stage:
     Severity:  Normal               |  Unreviewed
     Keywords:  field validation,    |      Needs documentation:  0
  model                              |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by timo):

 It is valid based on `blank=True` though. A use case for `blank=True,
 null=False` would be a field that gets populated in `save()`, for example.
 If we changed the behavior, it would be backwards incompatible and
 wouldn't allow this use case anymore. If you want the field required for
 model validation but not for form validation, then you should drop
 `blank=True` on the model and customize the form.

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

Reply via email to