-
-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] If validate assignment is true, the value will not change. #1223
Comments
I've been debugging this over the past couple of hours, and seems to be related how pydantic updates fields after they've been validated; appears pydantic-core is updating the dict property directly: https://github.com/pydantic/pydantic-core/blob/0e6b377d2bef52e744deff22314269c8751f7b00/src/validators/dataclass.rs#L368 (I'm not super familiar with the pydantic codebase so I may be looking at the wrong place) However, I did validate this by debugging through the existing test added in the PR you linked @milksys.
Looks like the dict of the DjangoGetter is getting updated directly, rather than the _obj, which is the representation of the actual object being validated. I don't have a good solution yet, will try and tackle it this weekend unless someone else gets to it first. |
If validate assignment is true, the value will not change.
this is sampel code
Describe the bug
In the previous 1.1.0 version, that PR threw an error, but now the value does not change (#1024)
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: