Merge pull request #11630 from saurabh6790/domain_settings_fix

[fix] set default language in local
This commit is contained in:
Saurabh 2017-11-17 14:54:38 +05:30 committed by GitHub
commit 119a50e228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,9 @@ from frappe import _
def execute():
language = frappe.get_single("System Settings").language
if language.startswith('en'): return
if language and language.startswith('en'): return
frappe.local.lang = language
all_domains = frappe.get_hooks("domains")
@ -16,11 +18,14 @@ def execute():
domain_settings = frappe.get_single("Domain Settings")
active_domains = [d.domain for d in domain_settings.active_domains]
for domain in active_domains:
domain = frappe.get_doc("Domain", domain)
domain.setup_domain()
try:
for domain in active_domains:
domain = frappe.get_doc("Domain", domain)
domain.setup_domain()
if int(frappe.db.get_single_value('System Settings', 'setup_complete')):
domain.setup_sidebar_items()
domain.setup_desktop_icons()
domain.set_default_portal_role()
if int(frappe.db.get_single_value('System Settings', 'setup_complete')):
domain.setup_sidebar_items()
domain.setup_desktop_icons()
domain.set_default_portal_role()
except frappe.LinkValidationError:
pass