This function doesn’t seem to be constructed correctly:
@frappe.whitelist() def get_roles(arg=None): """get roles for a user""" return frappe.get_roles(frappe.form_dict['uid']) // problem is the literal 'uid', which is not referenced anywhere else in the document
When I call
frappe.core.doctype.user.user.get_roles() I get a key error (which makes sense):
When I substitute a valid user name in the bench console I get the same key error.
I also can’t seem to find an instance of it actually being called, which makes me think it’s unused legacy code. It is not called in the test,
test_user.py. My best guess is that it’s useful but unfinished. If I’m not using it correctly, I’d be thrilled to be corrected.