fix: fixed the issue with rendering custom cohort page

Issue #271
This commit is contained in:
Anand Chitipothu
2021-12-05 00:01:42 +05:30
parent a1d0f3948a
commit ebcb3c5466
2 changed files with 6 additions and 1 deletions

View File

@@ -32,7 +32,7 @@
{% if not page %}
{{ render_subgroups() }}
{% else %}
{{ cohort.get_page_template(page) }}
{{ render_page(page) }}
{% endif %}
</div>

View File

@@ -31,3 +31,8 @@ def get_context(context):
context.is_mentor = is_mentor
context.is_admin = is_admin
context.page = frappe.form_dict.get("page") or ""
# Function to render to custom page given the slug
context.render_page = lambda page: frappe.render_template(
cohort.get_page_template(page),
context)