akarri2001 / Notion-and-Google-Calendar-2-Way-Sync

2 Way Sync Between Notion Database and Google Calendar
GNU General Public License v3.0
354 stars 51 forks source link

Added basic external organizer functionality. Previously, if one of t… #22

Open Mishark-dev opened 2 years ago

Mishark-dev commented 2 years ago

Hello! I was setting up your wonderful syncing tool and I noticed I kept getting errors. After investigating, I realized what was happening: The code was failing on Step 4 "Bring Events not in notion from GCAL to Notion".

It turns out that the issue was that I was trying to import events (in my gcal) that were made by other people , external organizers)as I call them.

These are added to the gCal_calendarID list but are not apart of the calendar dictionary (as I do not have permission to write to these calendars). Therefore, when trying to access calIds.index(external organizer) the code threw a Value Error. The solution I came up with is simply to add these events to the default calendar. This is a pretty naïve solution, but it makes the code operational. To do this I made an organizer_map() function, which you can find where gCal_calendarName is set.

Thank you for your time