Skip to content

Commit

Permalink
Ignore events that have the event type of workingLocation. (Fixes #363)…
Browse files Browse the repository at this point in the history
… (#364)
  • Loading branch information
MelissaAutumn authored Apr 17, 2024
1 parent 2d0377a commit 5e7c168
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion backend/src/appointment/controller/apis/google_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5e7c168

Please sign in to comment.