feat: content not visible to guest users
This commit is contained in:
@@ -5,15 +5,17 @@ import frappe
|
||||
no_cache = 1
|
||||
|
||||
def get_context(context):
|
||||
if frappe.session.user == "Guest":
|
||||
frappe.local.flags.redirect_location = '/lms'
|
||||
raise frappe.Redirect
|
||||
|
||||
context.course = frappe.form_dict['course']
|
||||
context.topic = frappe.form_dict['topic']
|
||||
content = frappe.form_dict['content']
|
||||
context.content_type = frappe.form_dict['type']
|
||||
|
||||
context.content = frappe.get_doc(context.content_type, content).as_dict()
|
||||
|
||||
context.previous = get_previous_content(context.topic, context.course, context.content, context.content_type)
|
||||
|
||||
context.next = get_next_content(context.topic, context.course, context.content, context.content_type)
|
||||
|
||||
def get_next_content(topic, course, content, content_type):
|
||||
|
||||
Reference in New Issue
Block a user