caldav_sync fix a walrus operator/and precedence bug

This commit is contained in:
Marc Durepos 2025-10-02 10:08:46 -04:00
parent ece737826c
commit 00a940672a

View file

@ -335,8 +335,9 @@ class CalendarEvent(models.Model):
) -> Optional[int]:
ical_instance = caldav_event.icalendar_instance
for index, component in enumerate(ical_instance.subcomponents):
if component.get("name") == "VEVENT" and (
rec_id := component.get("recurrence-id")
if (
component.get("name") == "VEVENT"
and (rec_id := component.get("recurrence-id"))
and rec_id.dt == self._get_ical_recurrence_id()
):
return index