Преглед изворни кода

[fix] Domain Setting patch (#4464)

* [fix] Domain Setting patch

* minor fix

* Update domain.py
version-14
Faris Ansari пре 7 година
committed by Nabin Hait
родитељ
комит
cd32e87b98
2 измењених фајлова са 9 додато и 2 уклоњено
  1. +4
    -0
      frappe/core/doctype/domain/domain.py
  2. +5
    -2
      frappe/patches/v9_1/resave_domain_settings.py

+ 4
- 0
frappe/core/doctype/domain/domain.py Прегледај датотеку

@@ -36,6 +36,10 @@ class Domain(Document):
'''Enable roles that are restricted to this domain'''
if self.data.restricted_roles:
for role_name in self.data.restricted_roles:
if not frappe.db.get_value('Role', role_name):
frappe.get_doc(dict(doctype='Role', role_name=role_name)).insert()
continue

role = frappe.get_doc('Role', role_name)
role.disabled = 0
role.save()


+ 5
- 2
frappe/patches/v9_1/resave_domain_settings.py Прегледај датотеку

@@ -1,7 +1,10 @@
import frappe

def execute():
domains = ['Education', 'Healthcare', 'Hospitality']
try:
frappe.get_single('Domain Settings').save()
for d in domains:
domain = frappe.get_doc('Domain', d)
domain.setup_domain()
except frappe.LinkValidationError:
pass
pass

Loading…
Откажи
Сачувај