From dda566c8d68418216b9ce46109c16ca24ec38ae1 Mon Sep 17 00:00:00 2001 From: vishwajeet-13 Date: Mon, 23 Mar 2026 13:18:23 +0530 Subject: [PATCH 1/2] fix: update webinar in zoom for event plus --- .../doctype/zoom_webinar/zoom_webinar.py | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py b/zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py index 8c24a40..fdea9c6 100644 --- a/zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py +++ b/zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py @@ -127,17 +127,30 @@ def update_webinar_on_zoom_if_applicable(self): if zoom_related_field_not_updated: return - url = f"{ZOOM_API_BASE_PATH}/webinars/{self.zoom_webinar_id}" headers = get_authenticated_headers_for_zoom() - body = json.dumps( - { - "topic": self.title, - "agenda": self.agenda or self.title, - "duration": cint(self.duration / 60) if self.duration else 60, - "start_time": format_datetime(f"{self.date} {self.start_time}", "yyyy-MM-ddTHH:mm:ss"), - "timezone": self.timezone or "Asia/Calcutta", - } - ) + + is_webinar_plus = bool(self.zoom_event_id and self.zoom_ticket_id) + + if is_webinar_plus: + url = f"{ZOOM_API_BASE_PATH}/zoom_events/events/{self.zoom_event_id}" + body = json.dumps( + { + "title": self.title, + "description": self.description or self.agenda or self.title, + } + ) + else: + # Regular Webinar: Use Zoom Webinar API + url = f"{ZOOM_API_BASE_PATH}/webinars/{self.zoom_webinar_id}" + body = json.dumps( + { + "topic": self.title, + "agenda": self.agenda or self.title, + "duration": cint(self.duration / 60) if self.duration else 60, + "start_time": format_datetime(f"{self.date} {self.start_time}", "yyyy-MM-ddTHH:mm:ss"), + "timezone": self.timezone or "Asia/Calcutta", + } + ) response = requests.patch(url, headers=headers, data=body) if response.status_code == 204: From 2160de01048ea44873db41d79f7476639c798185 Mon Sep 17 00:00:00 2001 From: vishwajeet-13 Date: Mon, 23 Mar 2026 13:22:05 +0530 Subject: [PATCH 2/2] fix: body --- .../zoom_integration/doctype/zoom_webinar/zoom_webinar.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py b/zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py index fdea9c6..059be3a 100644 --- a/zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py +++ b/zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py @@ -135,8 +135,11 @@ def update_webinar_on_zoom_if_applicable(self): url = f"{ZOOM_API_BASE_PATH}/zoom_events/events/{self.zoom_event_id}" body = json.dumps( { - "title": self.title, - "description": self.description or self.agenda or self.title, + "topic": self.title, + "agenda": self.agenda or self.title, + "duration": cint(self.duration / 60) if self.duration else 60, + "start_time": format_datetime(f"{self.date} {self.start_time}", "yyyy-MM-ddTHH:mm:ss"), + "timezone": self.timezone or "Asia/Calcutta", } ) else: