From ba23cf97896255ae3c33038ba9885c03bba5f6c6 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 10 Oct 2025 11:39:40 +0530 Subject: [PATCH 1/2] fix: misc zoom issues --- lms/lms/doctype/lms_batch/lms_batch.py | 8 +++++++- lms/lms/doctype/lms_live_class/lms_live_class.py | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index 07752df8..6964520e 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -146,7 +146,10 @@ def create_live_class( auto_recording, description=None, ): - frappe.only_for("Moderator") + instructors = frappe.get_all( + "Course Instructor", {"parenttype": "LMS Batch", "parent": batch_name}, pluck="instructor" + ) + payload = { "topic": title, "start_time": format_datetime(f"{date} {time}", "yyyy-MM-ddTHH:mm:ssZ"), @@ -155,6 +158,9 @@ def create_live_class( "private_meeting": True, "auto_recording": "none" if auto_recording == "No Recording" else auto_recording.lower(), "timezone": timezone, + "settings": { + "alternate_hosts": ";".join(instructors) if instructors else "", + }, } headers = { "Authorization": "Bearer " + authenticate(zoom_account), diff --git a/lms/lms/doctype/lms_live_class/lms_live_class.py b/lms/lms/doctype/lms_live_class/lms_live_class.py index 5a54c56a..f54372fc 100644 --- a/lms/lms/doctype/lms_live_class/lms_live_class.py +++ b/lms/lms/doctype/lms_live_class/lms_live_class.py @@ -29,6 +29,7 @@ class LMSLiveClass(Document): { "doctype": "Event", "subject": f"Live Class on {self.title}", + "event_type": "Public", "starts_on": start, "ends_on": get_datetime(start) + timedelta(minutes=cint(self.duration)), } @@ -38,7 +39,9 @@ class LMSLiveClass(Document): def add_event_participants(self, event, calendar): participants = frappe.get_all("LMS Batch Enrollment", {"batch": self.batch_name}, pluck="member") - instructors = frappe.get_all("Course Instructor", {"parent": self.batch_name}, pluck="instructor") + instructors = frappe.get_all( + "Course Instructor", {"parenttype": "LMS Batch", "parent": self.batch_name}, pluck="instructor" + ) participants.append(frappe.session.user) participants.extend(instructors) From ea59d1158a2a9775f8ab01d977d628dc35ab78e5 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 10 Oct 2025 11:40:19 +0530 Subject: [PATCH 2/2] fix: misc zoom issues --- lms/lms/doctype/lms_batch/lms_batch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index 6964520e..1f7e8306 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -159,7 +159,7 @@ def create_live_class( "auto_recording": "none" if auto_recording == "No Recording" else auto_recording.lower(), "timezone": timezone, "settings": { - "alternate_hosts": ";".join(instructors) if instructors else "", + "alternative_hosts": ";".join(instructors) if instructors else "", }, } headers = {