perf: avoid unnecessary query for user type

WHY?
This commit is contained in:
Ankush Menat 2025-01-14 18:45:08 +05:30
parent 80f324cc04
commit a8265bdc30

View file

@ -23,7 +23,7 @@ def get_context(context):
frappe.msgprint(_("Log in to access this page."))
frappe.redirect(f"/login?{urlencode({'redirect-to': frappe.request.path})}")
elif frappe.db.get_value("User", frappe.session.user, "user_type", order_by=None) == "Website User":
elif frappe.session.data.user_type == "Website User":
frappe.throw(_("You are not permitted to access this page."), frappe.PermissionError)
try: