diff --git a/caldav/objects.py b/caldav/objects.py index 8ef887ef..3c758dfe 100644 --- a/caldav/objects.py +++ b/caldav/objects.py @@ -1817,7 +1817,6 @@ def set_relation( """ ##TODO: test coverage reltype = reltype.upper() - reltype_reverse = self.RELTYPE_REVERSER[reltype] if isinstance(other, CalendarObjectResource): if other.id: uid = other.id @@ -1828,6 +1827,7 @@ def set_relation( if set_reverse: other = self.parent.object_by_uid(uid) if set_reverse: + reltype_reverse = self.RELTYPE_REVERSER[reltype] other.set_relation(other=self, reltype=reltype_reverse, set_reverse=False) existing_relation = self.icalendar_component.get("related-to", None)