Repository navigation
Conversation
417c35d to
0ac89e4
Compare
0ac89e4 to
9bd7a20
Compare
5b7828f to
23fa4d2
Compare
|
Rebased onto the current 2.x, and the change had to be rewritten rather than replayed. When this branch was first written, One thing is new since the commit was written. 2.x now skips the whole-object validation for a custom The branch also carried the commit of #106, which is on 2.x now. It is dropped, so the diff is this change alone.
|
update_object_with_data re-validated the whole object after applying the record. The field managers already validate each submitted field on set, so that second pass only re-checks untouched fields, and fails when one of them no longer passes a full validation on its own: an Archetypes field holding a stored legacy value, or a Dexterity behavior invariant such as IExcludeFromNavigationDefault. A partial update of a setup object was refused even when the submitted field itself was fine. Creation still validates the whole object, which is what #66 is about. Rewritten against the current 2.x: the route helpers moved to api/mutation in #97 after this change was first written.
23fa4d2 to
8b53ce3
Compare
Description of the issue/feature this PR addresses
update_object_with_datare-validates the whole object after applying the record. The field managers already validate each submitted field onset, so this second pass only re-checks fields the caller never touched, and it fails when one of them no longer passes a full validation: an Archetypes field holding a stored legacy value, or a Dexterity behavior invariant such asIExcludeFromNavigationDefault. In practice this blocks partial updates to setup objects (for example toggling a singlebika_setupflag, or setting a Sample'sSpecification), even though the submitted field itself is valid.This skips the redundant whole-object validation on the update route. Each submitted field is still validated on
set(so invalid input is still rejected), while creation keeps validating the full object, preserving the behavior added in #66.Current behavior before PR
A partial update (
POST update/<uid>with a single field) runs a full-object validation and can return400with errors for untouched fields, or fail on a behavior invariant.Desired behavior after PR is merged
The update only validates the fields that were submitted; unrelated untouched fields are left alone. Submitting an invalid field is still rejected. Covered by a new
Partial validation on updatesection inupdate.rst.--
I confirm I have coded it according to PEP8 standards.