feat: cache employee name in session data on boot

This commit is contained in:
El-Shafei H.
2025-10-09 08:25:58 +03:00
committed by GitHub
parent e2d4ce74d9
commit 83d575206b

View File

@@ -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 = ""