Merge branch 'master' into develop

This commit is contained in:
Nabin Hait 2017-11-13 15:09:07 +05:30
commit a3c6497f00
3 changed files with 10 additions and 3 deletions

View file

@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template
__version__ = '9.2.10'
__version__ = '9.2.11'
__title__ = "Frappe Framework"
local = Local()

View file

@ -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()

View file

@ -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