fix: Eliminate broken & impermissible links from get_linked_docs

This commit is contained in:
Gavin D'souza 2022-03-07 15:44:30 +05:30
parent 6edb1f09e4
commit 38fbe76ebf

View file

@ -380,9 +380,15 @@ def get_linked_docs(doctype: str, name: str, linkinfo: Dict = None) -> Dict[str,
for dt, link in linkinfo.items():
filters = []
link["doctype"] = dt
link_meta_bundle = frappe.desk.form.load.get_meta_bundle(dt)
try:
link_meta_bundle = frappe.desk.form.load.get_meta_bundle(dt)
except Exception:
continue
linkmeta = link_meta_bundle[0]
if not linkmeta.has_permission():
continue
if not linkmeta.get("issingle"):
fields = [d.fieldname for d in linkmeta.get("fields", {
"in_list_view": 1,