adds calendar_type to calendar model and to calendar handling

This commit is contained in:
2020-07-25 11:28:59 +02:00
parent 2add28fa00
commit 524d2f1e1d
3 changed files with 4 additions and 2 deletions

View File

@ -130,7 +130,7 @@ def fetchCalendarEvents(user, calendars, startDate, endDate):
all_events = []
for calendar in calendars:
if calendar.toggle == "True":
if calendar.toggle == "True" and calendar.calType == "Google":
event_result = service.events().list(calendarId=calendar.calendar_id,
timeMin=startDate,
timeMax=endDate,
@ -178,6 +178,7 @@ def fetchCalendars():
calendar_list = service.calendarList().list(pageToken=page_token).execute()
for calendar in calendar_list['items']:
calendars.append(Calendar(name=calendar['summary'],
calType="Google",
calendarId=calendar['id'],
color=calendar['colorId']))
page_token = calendar_list.get('nextPageToken')