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

Fix invalid values in RelationListFieldSerializer. #1818

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

Faakhir30
Copy link
Contributor

@Faakhir30 Faakhir30 commented Sep 27, 2024

Closes #1745

Filtered NoneType items from the resulting list at RelationListFieldSerializer.

I guess we don't need to update this also in RelationChoiceFieldSerializer, as it is returning a single RelationValue or None value, so it should be fine this way.


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

@mister-roboto
Copy link

@Faakhir30 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!

src/plone/restapi/serializer/relationfield.py Outdated Show resolved Hide resolved
src/plone/restapi/serializer/relationfield.py Outdated Show resolved Hide resolved
@wesleybl
Copy link
Member

I think it would be interesting to do a test for this here:

class TestDXContentSerializer(unittest.TestCase):

You can use the test_relationlist_field field:

test_relationlist_field = RelationList(

@Faakhir30 Faakhir30 requested a review from wesleybl September 28, 2024 18:36
@Faakhir30
Copy link
Contributor Author

@jenkins-plone-org please run jobs

@Faakhir30
Copy link
Contributor Author

@jenkins-plone-org please run jobs

Copy link
Member

@wesleybl wesleybl left a comment

Choose a reason for hiding this comment

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

LGTM

@Faakhir30
Copy link
Contributor Author

@jenkins-plone-org please run jobs

@Faakhir30 Faakhir30 force-pushed the serializer_bug_1745 branch from 7de6017 to 8c67abe Compare October 2, 2024 17:09
@Faakhir30 Faakhir30 requested a review from davisagli October 2, 2024 17:11
@davisagli
Copy link
Member

@jenkins-plone-org please run jobs

Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

LGTM. We can merge it once the builds are green.

@davisagli davisagli merged commit f68fab7 into main Oct 2, 2024
23 of 25 checks passed
@davisagli davisagli deleted the serializer_bug_1745 branch October 2, 2024 21:00
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.

relatedItems field returns None in the serializer if the related item is deleted
4 participants