fix: add better error handling
This commit is contained in:
parent
3d0cb00c43
commit
e0a7775d59
1 changed files with 10 additions and 3 deletions
|
|
@ -5,8 +5,15 @@ from frappe.model.sync import check_if_record_exists
|
|||
def execute():
|
||||
for sidebar in frappe.get_all("Workspace Sidebar", pluck="name"):
|
||||
sidebar_doc = frappe.get_doc("Workspace Sidebar", sidebar)
|
||||
|
||||
if sidebar_doc.app and check_if_record_exists(
|
||||
"app", frappe.get_app_path(sidebar_doc.app), "Workspace Sidebar", sidebar_doc.name
|
||||
"app",
|
||||
frappe.get_app_path(sidebar_doc.app),
|
||||
"Workspace Sidebar",
|
||||
sidebar_doc.name,
|
||||
):
|
||||
sidebar_doc.standard = 1
|
||||
sidebar_doc.save()
|
||||
try:
|
||||
sidebar_doc.standard = 1
|
||||
sidebar_doc.save()
|
||||
except Exception as e:
|
||||
print("Error in setting standard field", e)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue