backend now uses calendar_id and this is the frontend upgrade

- calendar_id is unique and therefore creates less problems
- changing id of DOM from item.name to calendar_id
This commit is contained in:
2020-05-18 23:52:18 +02:00
parent ee54dd5daa
commit 4a8ac52201
7 changed files with 31 additions and 18 deletions

View File

@ -94,21 +94,22 @@ def get_google_provider_cfg():
return requests.get(GOOGLE_DISCOVERY_URL).json()
class Calendar:
def __init__(self, name, toggle='False', color="#000000"):
def __init__(self, name, calendarId, toggle='False', color="#000000"):
self.name = name
self.color = color
self.toggle=toggle
self.calendarId = calendarId
def calendarsFromDb():
calendars = dbCalendar.getCalendars(dbCalendar, current_user.id)
pyCalendars = []
for calendar in calendars:
name = calendar.name
# calId = calendar.calendar_id
calendarId = calendar.calendar_id
toggle = calendar.toggle
color = calendar.color
pyCalendars.append(Calendar(name, toggle, color))
pyCalendars.append(Calendar(name, calendarId, toggle, color))
return pyCalendars