perf: avoid unnecessary query for user type
WHY?
This commit is contained in:
parent
80f324cc04
commit
a8265bdc30
1 changed files with 1 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue