feat: redirect the course page to learn page when the visitor is a student of a batch

This commit is contained in:
Anand Chitipothu
2021-05-14 12:06:37 +05:30
parent 5cfb72a731
commit 1cf57c4823
2 changed files with 34 additions and 0 deletions

View File

@@ -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