webnotes.user.roles deprecated to webnotes.user.get_roles()
diff --git a/accounts/page/accounts_browser/accounts_browser.py b/accounts/page/accounts_browser/accounts_browser.py
index 8b24394..7c8116c 100644
--- a/accounts/page/accounts_browser/accounts_browser.py
+++ b/accounts/page/accounts_browser/accounts_browser.py
@@ -10,9 +10,10 @@
# check if match permission exists
res = webnotes.conn.sql("""select role, `match` from `tabDocPerm`
where parent='Account' and permlevel=0 and `read`=1""", as_dict=1)
-
+
+ roles = webnotes.user.get_roles()
match = any((r["match"] for r in res
- if r["role"] in webnotes.user.roles and r["match"]=="company"))
+ if r["role"] in roles and r["match"]=="company"))
# if match == company is specified and companies are specified in user defaults
if match and webnotes.user.get_defaults().get("company"):
diff --git a/startup/event_handlers.py b/startup/event_handlers.py
index f526c73..4808298 100644
--- a/startup/event_handlers.py
+++ b/startup/event_handlers.py
@@ -115,7 +115,7 @@
from webnotes.utils import formatdate
msg = """Oops! Your subscription expired on <b>%s</b>.<br>""" % formatdate(conf.expires_on)
- if 'System Manager' in webnotes.user.roles:
+ if 'System Manager' in webnotes.user.get_roles():
msg += """Just drop in a mail at <b>support@erpnext.com</b> and
we will guide you to get your account re-activated."""
else: