From ac95378690464a04b1c9d0f179963029ef7673fc Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Tue, 19 Sep 2023 13:32:59 +0200 Subject: [PATCH] set_related: allow custom types with set_reverse=False --- caldav/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)