feat: redirect the course page to learn page when the visitor is a student of a batch
This commit is contained in:
@@ -19,3 +19,8 @@ def get_context(context):
|
||||
|
||||
context.course = course
|
||||
|
||||
batch = course.get_student_batch(frappe.session.user)
|
||||
if batch:
|
||||
frappe.local.flags.redirect_location = f"/courses/{course.name}/{batch.name}/learn"
|
||||
raise frappe.Redirect
|
||||
|
||||
|
||||
Reference in New Issue
Block a user