From e841219d0a9a1f75c6e70dabfb7f0e3598b1cb12 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 21 Jun 2017 14:26:23 +0530 Subject: [PATCH] Fix mobile app error frappe/erpnext#9406 --- frappe/www/desk.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frappe/www/desk.py b/frappe/www/desk.py index 21a1f00771..121786fb5c 100644 --- a/frappe/www/desk.py +++ b/frappe/www/desk.py @@ -56,8 +56,15 @@ def get_desk_assets(build_version): if build_version != data["build_version"]: # new build, send assets for path in data["include_js"]: - with open(os.path.join(frappe.local.sites_path, path) ,"r") as f: - assets[0]["data"] = assets[0]["data"] + "\n" + unicode(f.read(), "utf-8") + # assets path shouldn't start with / + # as it points to different location altogether + if path.startswith('/assets/'): + path = path.replace('/assets/', 'assets/') + try: + with open(os.path.join(frappe.local.sites_path, path) ,"r") as f: + assets[0]["data"] = assets[0]["data"] + "\n" + unicode(f.read(), "utf-8") + except IOError as e: + pass for path in data["include_css"]: with open(os.path.join(frappe.local.sites_path, path) ,"r") as f: