feat: read only mode
This commit is contained in:
@@ -8,6 +8,10 @@ no_cache = 1
|
||||
|
||||
|
||||
def get_context():
|
||||
context = frappe._dict()
|
||||
context.boot = get_boot()
|
||||
frappe.db.commit()
|
||||
|
||||
app_path = frappe.form_dict.get("app_path")
|
||||
favicon = (
|
||||
frappe.db.get_single_value("Website Settings", "favicon")
|
||||
@@ -15,19 +19,24 @@ def get_context():
|
||||
)
|
||||
title = frappe.db.get_single_value("Website Settings", "app_name") or "Frappe Learning"
|
||||
|
||||
csrf_token = frappe.sessions.get_csrf_token()
|
||||
frappe.db.commit()
|
||||
|
||||
context = frappe._dict()
|
||||
context.csrf_token = csrf_token
|
||||
context.read_only = frappe.flags.read_only
|
||||
context.meta = get_meta(app_path, title, favicon)
|
||||
capture("active_site", "lms")
|
||||
context.title = title
|
||||
context.favicon = favicon
|
||||
|
||||
capture("active_site", "lms")
|
||||
return context
|
||||
|
||||
|
||||
def get_boot():
|
||||
return frappe._dict(
|
||||
{
|
||||
"frappe_version": frappe.__version__,
|
||||
"read_only_mode": frappe.flags.read_only,
|
||||
"csrf_token": frappe.sessions.get_csrf_token(),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def get_meta(app_path, title, favicon):
|
||||
meta = frappe._dict()
|
||||
if app_path:
|
||||
|
||||
Reference in New Issue
Block a user