webnotes.user.roles deprecated to webnotes.user.get_roles()
This commit is contained in:
parent
686022f777
commit
d1b2afcd18
@ -11,8 +11,9 @@ def get_companies():
|
||||
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"):
|
||||
|
@ -115,7 +115,7 @@ def check_if_expired():
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user