diff --git a/backend/src/appointment/controller/apis/google_client.py b/backend/src/appointment/controller/apis/google_client.py index 22fa19c45..e301866bd 100644 --- a/backend/src/appointment/controller/apis/google_client.py +++ b/backend/src/appointment/controller/apis/google_client.py @@ -114,10 +114,18 @@ def list_events(self, calendar_id, time_min, time_max, token): ) ) + # Explicitly ignore workingLocation events + # See: https://developers.google.com/calendar/api/v3/reference/events#eventType + event_types = [ + 'default', + 'focusTime', + 'outOfOffice' + ] + with build("calendar", "v3", credentials=token, cache_discovery=False) as service: request = service.events().list( calendarId=calendar_id, timeMin=time_min, timeMax=time_max, singleEvents=True, orderBy="startTime", - fields=fields + eventTypes=event_types, fields=fields ) while request is not None: try: