Browse Source

[fix] system_country can be none

version-14
Rushabh Mehta 8 years ago
parent
commit
1ba6e32508
2 changed files with 4 additions and 3 deletions
  1. +2
    -2
      frappe/__init__.py
  2. +2
    -1
      frappe/desk/form/meta.py

+ 2
- 2
frappe/__init__.py View File

@@ -1364,6 +1364,6 @@ def get_active_domains():
return active_domains return active_domains


def get_system_country(): 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 return local.system_country

+ 2
- 1
frappe/desk/form/meta.py View File

@@ -68,7 +68,8 @@ class FormMeta(Meta):
system_country = frappe.get_system_country() system_country = frappe.get_system_country()


self._add_code(_get_path(self.name + '.js'), '__js') 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 + '.css'), "__css")
self._add_code(_get_path(self.name + '_list.js'), '__list_js') self._add_code(_get_path(self.name + '_list.js'), '__list_js')
self._add_code(_get_path(self.name + '_calendar.js'), '__calendar_js') self._add_code(_get_path(self.name + '_calendar.js'), '__calendar_js')


Loading…
Cancel
Save