fix: patch conditions
This commit is contained in:
parent
3b42327fc2
commit
c3a2ba0f93
1 changed files with 4 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ def rebuild_links(page):
|
|||
except frappe.DoesNotExistError:
|
||||
db_doc = get_doc_from_db(page)
|
||||
|
||||
doc = frappe.new_doc(db_doc)
|
||||
doc = frappe.get_doc(db_doc)
|
||||
doc.insert(ignore_permissions=True)
|
||||
|
||||
doc.links = []
|
||||
|
|
@ -41,6 +41,9 @@ def rebuild_links(page):
|
|||
})
|
||||
|
||||
for link in links:
|
||||
if not frappe.db.exists(get_link_type(link.get('type')), link.get('name')):
|
||||
continue
|
||||
|
||||
doc.append('links', {
|
||||
"label": link.get('label') or link.get('name'),
|
||||
"type": "Link",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue