diff --git a/backend b/backend index 45cd71c..fec09ed 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit 45cd71cc4bcddf23f46b1eddcffd8c7fda2b9d41 +Subproject commit fec09edb888013c5cb9c062d5cdb2220bc1a217d diff --git a/database/models.py b/database/models.py index 6dc7ac5..759c22c 100644 --- a/database/models.py +++ b/database/models.py @@ -67,6 +67,7 @@ class Calendar(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), index=True, nullable=False) calendar_id = db.Column(db.String(256), primary_key=True) + calendar_type = db.Column(db.String(32), index=True) name = db.Column(db.String(256), index=True) toggle = db.Column(db.String(8)) color = db.Column(db.String(16)) diff --git a/server/googleHandler.py b/server/googleHandler.py index 095fe23..03879f0 100644 --- a/server/googleHandler.py +++ b/server/googleHandler.py @@ -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')