feat: #28 info page, #27 discussion page initial structure, add batch webform change

This commit is contained in:
pateljannat
2021-04-27 10:33:49 +05:30
parent 44dc42d7dd
commit 424967b03e
18 changed files with 372 additions and 185 deletions

View File

@@ -1,8 +1,15 @@
import frappe
from community.www.courses.utils import redirect_if_not_a_member
from community.www.courses.utils import redirect_if_not_a_member, get_course, get_batch_members, get_batch
from community.lms.doctype.lms_batch.lms_batch import get_messages
def get_context(context):
context.no_cache = 1
context.course = frappe.form_dict["course"]
context.course_slug = frappe.form_dict["course"]
context.course = get_course(context.course_slug)
context.batch_code = frappe.form_dict["batch"]
redirect_if_not_a_member(context.course, context.batch_code)
redirect_if_not_a_member(context.course_slug, context.batch_code)
context.batch = get_batch(context.batch_code)
context.members = get_batch_members(context.batch.name)
context.member_count = len(context.members)
context.messages = get_messages(context.batch.name)