Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,33 @@ 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(
{
"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:
# 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:
Expand Down
Loading