updates database design

This commit is contained in:
Raphael Maenle 2020-05-27 20:05:25 +02:00
parent 26cc3425ee
commit fe1c216c29

View File

@ -14,7 +14,7 @@ class Routine:
def updateCalendar(self, user):
# check google:
credentials = user.getGoogleCredentials()
credentials = user.google_token
if credentials is None:
return
@ -23,6 +23,8 @@ class Routine:
for calendar in calendars:
if calendar.toggle == 'True':
visualCals.append(calendar.calendar_id)
client_token = GC.build_credentials(user.google_token.token,
user.google_token.refresh_token)
googleCreds = google.oauth2.credentials.Credentials(**credentials)
calendarjson = caltojson.generateJsonFromCalendarEntries(visualCals, googleCreds)
user.setJson(calendarjson)