import jingrow
from jingrow.utils import cint

no_cache = 1


def get_context(context):
	jingrow.db.commit()  # nosemgrep
	context = jingrow._dict()
	context.boot = get_boot()
	return context


def get_boot():
	return jingrow._dict(
		{
			"site_name": jingrow.local.site,
			"read_only_mode": jingrow.flags.read_only,
			"csrf_token": jingrow.sessions.get_csrf_token(),
			"setup_complete": cint(jingrow.get_system_settings("setup_complete")),
		}
	)
