Commit cd32e87b authored by Faris Ansari's avatar Faris Ansari Committed by Nabin Hait
Browse files

[fix] Domain Setting patch (#4464)

* [fix] Domain Setting patch

* minor fix

* Update domain.py
parent 60036a0b
Showing with 9 additions and 2 deletions
+9 -2
......@@ -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()
......
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
\ No newline at end of file
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment