perf(desk): Use cached meta

This commit is contained in:
Aditya Hase 2019-10-23 22:21:49 +05:30
parent c7a04add35
commit e3df3f0b17
No known key found for this signature in database
GPG key ID: 2F5E3D5822BBF831

View file

@ -159,7 +159,7 @@ class UserPermissions:
if "System Manager" in self.get_roles():
docs = [x["name"] for x in frappe.get_all("DocType", "name")]
for docname in docs:
if frappe.get_meta(docname, cached=False).allow_import == 1:
if frappe.get_meta(docname, cached=True).allow_import == 1:
self.can_import.append(docname)
frappe.cache().hset("can_import", frappe.session.user, self.can_import)