feat: allow the same custom page to be avaiable both for cohort and subgroup

This commit is contained in:
Anand Chitipothu
2021-12-14 22:09:51 +05:30
parent 8f740d70e0
commit 465bc3b24a
2 changed files with 3 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ def get_context(context):
context.is_mentor = is_mentor
context.is_admin = is_admin
context.page = frappe.form_dict.get("page") or ""
context.page_scope = "Cohort"
# Function to render to custom page given the slug
context.render_page = lambda page: frappe.render_template(

View File

@@ -49,10 +49,11 @@ def get_context(context):
context.page = page
context.is_admin = is_admin
context.is_mentor = is_mentor
context.page_scope = "Subgroup"
# Function to render to custom page given the slug
context.render_page = lambda page: frappe.render_template(
cohort.get_page_template(page),
cohort.get_page_template(page, scope="Subgroup"),
context)
def get_stats(subgroup):