From 5ec1a1a737de45ed09ef8153f078bcf30f586676 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Tue, 19 Sep 2023 23:52:01 +0200 Subject: [PATCH] work around icalendar ignoring additional parameters workarounds https://github.com/collective/icalendar/issues/557 fixes #334 --- caldav/objects.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/caldav/objects.py b/caldav/objects.py index 3c758dfe..45837ee2 100644 --- a/caldav/objects.py +++ b/caldav/objects.py @@ -1840,6 +1840,12 @@ def set_relation( if rel == uid: return + # without str(…), icalendar ignores properties + # because if type(uid) == vText + # then Component._encode does miss adding properties + # see https://github.com/collective/icalendar/issues/557 + # workaround should be safe to remove if issue gets fixed + uid = str(uid) self.icalendar_component.add( "related-to", uid, parameters={"RELTYPE": reltype}, encode=True )