Skip to content

Commit

Permalink
work around icalendar ignoring additional parameters
Browse files Browse the repository at this point in the history
workarounds collective/icalendar#557
fixes #334
  • Loading branch information
Zocker1999NET authored and tobixen committed Sep 19, 2023
1 parent ac95378 commit 5ec1a1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions caldav/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 5ec1a1a

Please sign in to comment.