From dd1ee6ff44edd73cf5dc89fc4247881d0fbc0ebf Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Sat, 16 May 2020 06:56:48 -0700 Subject: [PATCH] Fix bug (#1196) ``` $ gam calendar testsimple@rdschool.org addevent start 2020-05-17T08:00:00-07:00 end 2020-05-17T09:00:00-07:00 recurrence "RRULE:FREQ=WEEKLY;WKST=SU;COUNT=13;BYDAY=MO" summary "Monday Morning Meeting" Traceback (most recent call last): File "/Users/Ross/Documents/GoogleApps/GAMO/gam.py", line 11, in main(sys.argv) File "/Users/Ross/Documents/GoogleApps/GAMO/gam/__main__.py", line 45, in main sys.exit(gam.ProcessGAMCommand(sys.argv)) File "/Users/Ross/Documents/GoogleApps/GAMO/gam/__init__.py", line 14413, in ProcessGAMCommand gapi_calendar.addOrUpdateEvent('add') File "/Users/Ross/Documents/GoogleApps/GAMO/gam/gapi/calendar.py", line 350, in addOrUpdateEvent sendUpdates, body = getEventAttributes(i, calendarId, cal, body, action) File "/Users/Ross/Documents/GoogleApps/GAMO/gam/gapi/calendar.py", line 537, in getEventAttributes if not timeZone: UnboundLocalError: local variable 'timeZone' referenced before assignment ``` --- src/gam/gapi/calendar.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gam/gapi/calendar.py b/src/gam/gapi/calendar.py index 5ba0effb..39ee6350 100644 --- a/src/gam/gapi/calendar.py +++ b/src/gam/gapi/calendar.py @@ -372,6 +372,7 @@ def getEventAttributes(i, calendarId, cal, body, action): # calendars are notified of changes sendUpdates = 'externalOnly' action = 'update' if body else 'add' + timeZone = None while i < len(sys.argv): myarg = sys.argv[i].lower().replace('_', '') if myarg in ['notifyattendees', 'sendnotifications', 'sendupdates']: