From a99575f6c67939550926d656c3ebdb92fdea1660 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 23 Dec 2016 11:05:21 +0530 Subject: [PATCH] [fix] [test] --- frappe/website/context.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frappe/website/context.py b/frappe/website/context.py index 1025a0bd66..e2edd9f562 100644 --- a/frappe/website/context.py +++ b/frappe/website/context.py @@ -106,11 +106,12 @@ def build_context(context): context.no_cache = 1 add_sidebar_data(context) else: - sidebar_json_path = os.path.join(context.basepath, '_sidebar.json') - if os.path.exists(sidebar_json_path): - with open(sidebar_json_path, 'r') as sidebarfile: - context.sidebar_items = json.loads(sidebarfile.read()) - context.show_sidebar = 1 + if context.basepath: + sidebar_json_path = os.path.join(context.basepath, '_sidebar.json') + if os.path.exists(sidebar_json_path): + with open(sidebar_json_path, 'r') as sidebarfile: + context.sidebar_items = json.loads(sidebarfile.read()) + context.show_sidebar = 1 # determine templates to be used