From 1ba6e325080ce17057ee0802935882f3bdc8c2e6 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 27 Jun 2017 17:45:09 +0530 Subject: [PATCH] [fix] system_country can be none --- frappe/__init__.py | 4 ++-- frappe/desk/form/meta.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index c6c65dbdf6..ddd6ca9829 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -1364,6 +1364,6 @@ def get_active_domains(): return active_domains def get_system_country(): - if not local.system_country: - local.system_country = db.get_single_value('System Settings', 'country') + if local.system_country is None: + local.system_country = db.get_single_value('System Settings', 'country') or '' return local.system_country diff --git a/frappe/desk/form/meta.py b/frappe/desk/form/meta.py index cd9f89eac4..48cacab3f6 100644 --- a/frappe/desk/form/meta.py +++ b/frappe/desk/form/meta.py @@ -68,7 +68,8 @@ class FormMeta(Meta): system_country = frappe.get_system_country() self._add_code(_get_path(self.name + '.js'), '__js') - self._add_code(_get_path(os.path.join('regional', system_country + '.js')), '__js') + if system_country: + self._add_code(_get_path(os.path.join('regional', system_country + '.js')), '__js') self._add_code(_get_path(self.name + '.css'), "__css") self._add_code(_get_path(self.name + '_list.js'), '__list_js') self._add_code(_get_path(self.name + '_calendar.js'), '__calendar_js')