From 72615449dbf46b6c4aa71ac2f7beb3c4af4fe04c Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Wed, 15 Jul 2020 14:19:51 +0530 Subject: [PATCH] fix: Use import_file_by_path to sync dashboard --- frappe/utils/dashboard.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/frappe/utils/dashboard.py b/frappe/utils/dashboard.py index fd8f8cea7b..1ff6380973 100644 --- a/frappe/utils/dashboard.py +++ b/frappe/utils/dashboard.py @@ -5,7 +5,7 @@ import frappe from frappe import _ from functools import wraps from frappe.utils import add_to_date, cint, get_link_to_form -from frappe.modules.import_file import import_doc +from frappe.modules.import_file import import_file_by_path import os from os.path import join @@ -107,9 +107,4 @@ def make_records(path, filters=None): if os.path.isdir(join(path, fname)): if fname == '__pycache__': continue - try: - doc_dict = frappe.get_file_json("{path}/{fname}/{fname}.json".format(path=path, fname=fname)) - import_doc(doc_dict) - except FileNotFoundError: - frappe.log_error(message=frappe.get_traceback(), title="Dashboard Import Error") - pass + import_file_by_path("{path}/{fname}/{fname}.json".format(path=path, fname=fname))