From 00fc674151dc4c06adb2f21fed027742e1a8eceb Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 22 Jan 2013 08:05:36 +0530 Subject: [PATCH] boot, get country if exists --- webnotes/boot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webnotes/boot.py b/webnotes/boot.py index 35a9522feb..6ff0725fb9 100644 --- a/webnotes/boot.py +++ b/webnotes/boot.py @@ -78,9 +78,11 @@ def get_bootinfo(): return bootinfo def load_country_and_currency(bootinfo, doclist): - if bootinfo.control_panel.country: + if bootinfo.control_panel.country and \ + webnotes.conn.exists("Country", bootinfo.control_panel.country): doclist += [webnotes.doc("Country", bootinfo.control_panel.country)] - if bootinfo.sysdefaults.currency: + if bootinfo.sysdefaults.currency and \ + webnotes.conn.exists("Currency", bootinfo.sysdefaults.currency): doclist += [webnotes.doc("Currency", bootinfo.sysdefaults.currency)] def add_allowed_pages(bootinfo):