From 4646ffd41d1518af85bed4f3f809125e84980619 Mon Sep 17 00:00:00 2001 From: Sylvia McLaughlin <85905333+sylviamclaughlin@users.noreply.github.com> Date: Thu, 27 Jun 2024 20:48:11 +0000 Subject: [PATCH] Fixing up an error where the result can be a tuple --- app/integrations/google_workspace/google_calendar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/integrations/google_workspace/google_calendar.py b/app/integrations/google_workspace/google_calendar.py index c0375117..6a149c3c 100644 --- a/app/integrations/google_workspace/google_calendar.py +++ b/app/integrations/google_workspace/google_calendar.py @@ -111,7 +111,12 @@ def insert_event(start, end, emails, title, incident_document, **kwargs): supportsAttachments=True, conferenceDataVersion=1, ) - return result.get("htmlLink") + # Handle the instance differently if the result is a dictionary or a tuple + if isinstance(result, dict): + htmllink = result.get("htmlLink") + elif isinstance(result, tuple): + htmllink = result[0].get("htmlLink") + return htmllink # Function to use the freebusy response to find the first available spot in the next 60 days. We look for a 30 minute windows, 3