mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-15 23:54:59 +00:00
feat: cache employee name in session data on boot
This commit is contained in:
@@ -81,9 +81,8 @@ def update_page_info(bootinfo):
|
||||
def bootinfo(bootinfo):
|
||||
if bootinfo.get("user") and bootinfo["user"].get("name"):
|
||||
bootinfo["user"]["employee"] = ""
|
||||
frappe.session.data.employee = ""
|
||||
employee = frappe.db.get_value("Employee", {"user_id": bootinfo["user"]["name"]}, "name")
|
||||
if employee:
|
||||
bootinfo["user"]["employee"] = employee
|
||||
frappe.session.data.employee = employee
|
||||
else:
|
||||
frappe.session.data.employee = ""
|
||||
|
||||
Reference in New Issue
Block a user