diff --git a/backend/src/appointment/controller/calendar.py b/backend/src/appointment/controller/calendar.py index 6bdfcc2f..fe1bbe96 100644 --- a/backend/src/appointment/controller/calendar.py +++ b/backend/src/appointment/controller/calendar.py @@ -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 )