Merge pull request #19099 from resilient-tech/check-doctype
fix: ensure correct parenttype when retrieving roles
This commit is contained in:
commit
41c8a808d0
1 changed files with 3 additions and 1 deletions
|
|
@ -427,7 +427,9 @@ def get_roles(user=None, with_standard=True):
|
|||
table = DocType("Has Role")
|
||||
roles = (
|
||||
frappe.qb.from_(table)
|
||||
.where((table.parent == user) & (table.role.notin(["All", "Guest"])))
|
||||
.where(
|
||||
(table.parenttype == "User") & (table.parent == user) & (table.role.notin(["All", "Guest"]))
|
||||
)
|
||||
.select(table.role)
|
||||
.run(pluck=True)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue