diff --git a/core/doctype/profile/profile.py b/core/doctype/profile/profile.py index 40cea1c3f5..d6a6f409b8 100644 --- a/core/doctype/profile/profile.py +++ b/core/doctype/profile/profile.py @@ -252,7 +252,17 @@ Thank you,
if not validate_email_add(email): webnotes.msgprint("%s is not a valid email id" % email) raise Exception - + + def add_roles(self, *roles): + for role in roles: + self.bean.doclist.append({ + "doctype": "UserRole", + "parentfield": "user_roles", + "role": role + }) + + self.bean.save() + @webnotes.whitelist() def get_all_roles(arg=None): """return all roles""" diff --git a/public/html/web.py b/public/html/web.py index 2a5a13bdd5..d99f1856e9 100755 --- a/public/html/web.py +++ b/public/html/web.py @@ -28,7 +28,7 @@ session_stopped = """
- %(app_name)s Upgrading... + %(app_name)s: Upgrading...

We will be back in a few moments.

diff --git a/templates/pages/login.html b/templates/pages/login.html index 26c44f7275..f0c6b20579 100644 --- a/templates/pages/login.html +++ b/templates/pages/login.html @@ -6,7 +6,7 @@ {% endblock %} diff --git a/webnotes/model/bean.py b/webnotes/model/bean.py index 926d0f52ff..ae2076551a 100644 --- a/webnotes/model/bean.py +++ b/webnotes/model/bean.py @@ -99,6 +99,9 @@ class Bean: self.controller = self.obj return self.obj + def get_controller(self): + return self.make_controller() + def to_dict(self): return [d.fields for d in self.doclist]