Skip to content

Commit

Permalink
fix: get current session user roles if uid is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
dj12djdjs committed Jun 20, 2024
1 parent a2bff44 commit 24b636a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/core/doctype/user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ def get_all_roles():
@frappe.whitelist()
def get_roles(arg=None):
"""get roles for a user"""
return frappe.get_roles(frappe.form_dict["uid"])
return frappe.get_roles(frappe.form_dict.get("uid", frappe.session.user))


@frappe.whitelist()
Expand Down

0 comments on commit 24b636a

Please sign in to comment.