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

Safely convert items to IContentListingObject #1810

Closed
wants to merge 5 commits into from

Conversation

erral
Copy link
Member

@erral erral commented Sep 12, 2024

Fixes #1809


📚 Documentation preview 📚: https://plonerestapi--1810.org.readthedocs.build/

@mister-roboto
Copy link

@erral thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@erral
Copy link
Member Author

erral commented Sep 12, 2024

@jenkins-plone-org please run jobs

try:
obj = IContentListingObject(self.context)
except TypeError:
return {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this just make it less obvious what the problem is? As a consumer of the API, I would find it surprising to see an empty object in a list of items, and I would wonder what happened. Better to throw the error that happens now, I think.

@erral erral closed this Oct 10, 2024
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

Successfully merging this pull request may close these issues.

Error when serializing a Collection that includes Events with recurrences
3 participants