Skip to content

Commit

Permalink
Filter out declined for Google Events (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn authored Oct 2, 2024
1 parent 0ce67e8 commit 79f87da
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backend/src/appointment/controller/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,17 @@ def list_events(self, start, end):
if status == 'cancelled' or transparency == 'transparent':
continue

# Mark tentative events
# Grab the attendee list for marking tentative events / filtering out declined events
attendees = event.get('attendees') or []
declined = any(
(attendee.get('self') and attendee.get('responseStatus') == 'declined') for attendee in attendees
)

# Don't show declined events
if declined:
continue

# Mark tentative events
tentative = any(
(attendee.get('self') and attendee.get('responseStatus') == 'tentative') for attendee in attendees
)
Expand Down

0 comments on commit 79f87da

Please sign in to comment.