Validate only the submitted fields on update - #107
Open
ramonski wants to merge 1 commit into
Open
Conversation
ramonski
added a commit
that referenced
this pull request
Jul 28, 2026
ramonski
force-pushed
the
feature/partial-update-validation
branch
2 times, most recently
from
July 28, 2026 18:00
417c35d to
0ac89e4
Compare
update_object_with_data re-validated the whole object after applying the record. Since the field managers already validate each submitted field on set, that second pass only re-checks untouched fields, and fails when one of them no longer passes a full validation: an Archetypes field holding a stored legacy value, or a Dexterity behavior invariant like IExcludeFromNavigationDefault. This blocked partial updates to setup objects even when the submitted field itself was valid. Skip the redundant whole-object validation on the update route; creation still validates the full object (preserving #66).
ramonski
force-pushed
the
feature/partial-update-validation
branch
from
July 28, 2026 18:21
0ac89e4 to
9bd7a20
Compare
ramonski
changed the base branch from
2.x
to
feature/fix-single-valued-uidreference
July 28, 2026 18:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.