Skip to content

Commit

Permalink
Check for existing relations of same attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed May 18, 2023
1 parent 028cc3c commit 89f68ac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/plone/api/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@ def create(source=None, target=None, relationship=None):
"from_id": from_id,
"to_id": to_id,
}
has_relation = False
for rel in relation_catalog.findRelations(query):
has_relation = True
has_relation = False if (
len([el for el in relation_catalog.findRelations(query)]) == 0) else True

if from_attribute == referencedRelationship:
# Don't mess with linkintegrity-relations!
Expand Down

0 comments on commit 89f68ac

Please sign in to comment.