Files
enlight-lms/lms/www/classes/index.py
2023-04-11 17:09:38 +05:30

14 lines
336 B
Python

import frappe
from frappe.utils import getdate
from lms.lms.utils import has_course_moderator_role
def get_context(context):
context.no_cache = 1
context.is_moderator = has_course_moderator_role()
context.classes = frappe.get_all(
"LMS Class",
{"end_date": [">=", getdate()]},
["name", "title", "start_date", "end_date"],
)