From 465bc3b24a920e91a84c48dde1bd54b3f17a6345 Mon Sep 17 00:00:00 2001 From: Anand Chitipothu Date: Tue, 14 Dec 2021 22:09:51 +0530 Subject: [PATCH] feat: allow the same custom page to be avaiable both for cohort and subgroup --- school/www/cohorts/cohort.py | 1 + school/www/cohorts/subgroup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/school/www/cohorts/cohort.py b/school/www/cohorts/cohort.py index 7f890367..64c63757 100644 --- a/school/www/cohorts/cohort.py +++ b/school/www/cohorts/cohort.py @@ -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( diff --git a/school/www/cohorts/subgroup.py b/school/www/cohorts/subgroup.py index 94c83764..4ab8c056 100644 --- a/school/www/cohorts/subgroup.py +++ b/school/www/cohorts/subgroup.py @@ -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):