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.
This commit is contained in:
Vaibhav Rathore
2026-02-27 19:52:07 +05:30
parent 2fab297745
commit cd9a6831a7

View File

@@ -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."))