#35367: Multi-field constraint are not correctly handled when a form has one 
field
marked as read-only
------------------------+--------------------------------------
     Reporter:  David   |                    Owner:  nobody
         Type:  Bug     |                   Status:  closed
    Component:  Forms   |                  Version:  4.2
     Severity:  Normal  |               Resolution:  wontfix
     Keywords:          |             Triage Stage:  Unreviewed
    Has patch:  0       |      Needs documentation:  0
  Needs tests:  0       |  Patch needs improvement:  0
Easy pickings:  0       |                    UI/UX:  0
------------------------+--------------------------------------
Comment (by Sarah Boyce):

 Hi David, to reiterate what David Sanders said, this is expected behaviour
 and documented. See:
 https://docs.djangoproject.com/en/5.0/ref/models/instances/#validating-
 objects
 In particular:
 > When you use a ModelForm, the call to is_valid() will perform these
 validation steps for all the fields that are included on the form. See the
 ModelForm documentation for more information. You should only need to call
 a model’s full_clean() method if you plan to handle validation errors
 yourself, or if you have excluded fields from the ModelForm that require
 validation.

 You need to call full_clean() as you have excluded a field required for
 validation purposes:
 
https://docs.djangoproject.com/en/5.0/ref/models/instances/#django.db.models.Model.validate_constraints
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35367#comment:2>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ec7c3165e-910213a2-c5f5-4d0a-bb0c-81e5567433ac-000000%40eu-central-1.amazonses.com.

Reply via email to