Skip to content

Commit

Permalink
Fix component check
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn committed Nov 19, 2024
1 parent 0e2fed1 commit 8a1b5e3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/src/appointment/controller/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,21 @@ def list_events(self, start, end):
continue

vevent = e.vobject_instance.vevent
if not vevent:
continue

event_components = vevent.components()

# Ignore events with missing datetime data
if not vevent or not vevent.dtstart or (not vevent.dtend and not vevent.duration):
if 'dtstart' not in event_components or (
'dtend' not in event_components and 'duration' not in event_components
):
continue

# Mark tentative events
tentative = status == 'tentative'

title = vevent.summary.value if vevent.summary else l10n('event-summary-default')
title = vevent.summary.value if 'summary' in event_components else l10n('event-summary-default')
start = vevent.dtstart.value
# get_duration grabs either end or duration into a timedelta
end = start + e.get_duration()
Expand Down

0 comments on commit 8a1b5e3

Please sign in to comment.