Skip to content
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

It is possible to create an empty AT content bypassing the validation #1386

Closed
gbastien opened this issue Apr 27, 2022 · 2 comments
Closed

Comments

@gbastien
Copy link
Member

gbastien commented Apr 27, 2022

Hi @stevepiercy @jensens
we still use version 7.x to create AT content on some applications and we encounter a bug: it is possible to create an empty content without required fields by just giving the "portal_type".
This is because in https://github.com/plone/plone.restapi/blob/7.x.x/src/plone/restapi/deserializer/atcontent.py#L55
In DeserializeFromJson, validation is only done if a field was modified, this is not the case and it fails.
Changing if modified: by if create or modified: fix the problem.
I will propose a PR for this.
Thank you,
Gauthier

gbastien added a commit that referenced this issue Apr 27, 2022
gbastien added a commit to IMIO/plonemeeting.restapi that referenced this issue Apr 27, 2022
…ializeFromJson.__call__` from `plone.restapi` until issue plone/plone.restapi#1386 is fixed.

See #PM-3869
@gbastien
Copy link
Member Author

gbastien commented May 6, 2022

Thank you for review and merge, I will wait for a release 7.x.x (but it is not urgent) before closing this issue

@gbastien
Copy link
Member Author

https://pypi.org/project/plone.restapi/7.8.0/ this version solves the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant