From cd9a6831a73535760f5df21f4b76c1849f3ae556 Mon Sep 17 00:00:00 2001 From: Vaibhav Rathore Date: Fri, 27 Feb 2026 19:52:07 +0530 Subject: [PATCH] fix: add type annotations and role validation to create_google_meet_live_class Add type hints to match create_live_class signature. Add frappe.only_for role check to prevent unauthorized access. --- lms/lms/doctype/lms_batch/lms_batch.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index 1b794d9b..bf3a0789 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -290,15 +290,17 @@ def create_live_class( @frappe.whitelist() def create_google_meet_live_class( - batch_name, - google_meet_account, - title, - duration, - date, - time, - timezone, - description=None, + batch_name: str, + google_meet_account: str, + title: str, + duration: int, + date: str, + time: str, + timezone: str, + description: str = None, ): + frappe.only_for(["Moderator", "Batch Evaluator"]) + google_meet_settings = frappe.get_doc("LMS Google Meet Settings", google_meet_account) if not google_meet_settings.enabled: frappe.throw(_("Please enable the Google Meet account to use this feature."))