-
-
Notifications
You must be signed in to change notification settings - Fork 744
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
put_internal doesn't skip validation on insert when skip_validation=True #1390
Comments
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Yes, this is still relevant. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Yes, this is still relevant. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Yes, this is still relevant. |
I would like to insert or update an item from internal server code, but the resource is complex and I don't want to replicate all the logic in Eve for timestamps, soft delete, media files, etc. in the application, so I'm trying to use
eve.methods.put.put_internal
for this. However, some of the fields changed from the server are marked read-only (as the client shouldn't be able to change them), so I want to skip validation (and also because I know the data is valid, so validation is redundant in this case).Unfortunately,
put_internal
isn't skipping validation on insert whenskip_validation=True
, because it simply callspost_internal
in eve/methods/put.py:153, but theskip_validation
parameter is not forwarded topost_internal
.Of course, there are workarounds:
post_internal
directly passingskip_validation=True
, but that means two queries in case of updates, becauseput_internal
will make another one anyway.app.data.insert
andapp.data.replace
(orapp.data.update
) directly.Expected Behavior
Calling
put_internal
withskip_validation=True
should always skip validation.Actual Behavior
Validation is skipped for updates, but not for inserts.
Environment
The text was updated successfully, but these errors were encountered: