fix: uncomment conditions that handle guest access for desk

This commit is contained in:
prssanna 2021-03-10 16:02:52 +05:30
parent 7eee5c1a35
commit aa8f7cc3c5

View file

@ -12,10 +12,10 @@ from frappe import _
import frappe.sessions
def get_context(context):
# if frappe.session.user == "Guest":
# frappe.throw(_("Log in to access this page."), frappe.PermissionError)
# elif frappe.db.get_value("User", frappe.session.user, "user_type") == "Website User":
# frappe.throw(_("You are not permitted to access this page."), frappe.PermissionError)
if frappe.session.user == "Guest":
frappe.throw(_("Log in to access this page."), frappe.PermissionError)
elif frappe.db.get_value("User", frappe.session.user, "user_type") == "Website User":
frappe.throw(_("You are not permitted to access this page."), frappe.PermissionError)
hooks = frappe.get_hooks()
try: