Closed szakitibi closed 4 months ago
Steps to reproduce
RelationList
some_related_stuff = RelationList( title="Some not required related stuff", value_type=RelationChoice(vocabulary='plone.app.vocabularies.Catalog'), required=False, )
default=[]
obj1
some_related_stuff
None
plone.api.relation.create
api.relation.create(source=obj1, target=obj2, relationship='some_related_stuff')
What happens
It goes into an error, since it gets None here:
https://github.com/plone/plone.api/blob/08884b755450cdc5290d640b826d3f659025179f/src/plone/api/relation.py#L220
What I expect
A relation created.
Steps to reproduce
RelationList
field:default=[]
, which according to the documentation is a dangerous default. (IRelatedItems has it 10 years now though?!?)obj1
with having nosome_related_stuff
relations, akaNone
value.plone.api.relation.create
.What happens
It goes into an error, since it gets
None
here:https://github.com/plone/plone.api/blob/08884b755450cdc5290d640b826d3f659025179f/src/plone/api/relation.py#L220
What I expect
A relation created.