Skip to content

Commit 15142d9

Browse files
committed
fix: model validator assignment consistency
Fix inconsistency where model-level before and wrap validators received different states during field assignment validation. During assignment with validate_assignment=True: - Before: before validators received dict with NEW field value - After: before validators receive dict with OLD field value (consistent with wrap validators) Both validator modes now consistently see the pre-update state during assignment. Fixes: pydantic/pydantic#11823"
1 parent 25b0649 commit 15142d9

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/validators/model.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ impl Validator for ModelValidator {
215215
if let Ok(old_extra) = model.getattr(intern!(py, DUNDER_MODEL_EXTRA_KEY))?.downcast::<PyDict>() {
216216
input_dict.update(old_extra.as_mapping())?;
217217
}
218-
input_dict.set_item(field_name, field_value)?;
219218

220219
let output = self
221220
.validator

0 commit comments

Comments
 (0)