Skip to content

Commit

Permalink
fix: better permission error for query_report (#20643) (#20646)
Browse files Browse the repository at this point in the history
(cherry picked from commit 08732e5)

Co-authored-by: Smit Vora <smitvora203@gmail.com>
  • Loading branch information
mergify[bot] and vorasmit committed Apr 11, 2023
1 parent 32ba65f commit d972af8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/desk/query_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def add_total_row(result, columns, meta=None, is_tree=False, parent_field=None):
def get_data_for_custom_field(doctype, fieldname, field=None):

if not frappe.has_permission(doctype, "read"):
frappe.throw(_("Not Permitted"), frappe.PermissionError)
frappe.throw(_("Not Permitted to read {0}").format(doctype), frappe.PermissionError)

if field:
custom_field = field + " as " + fieldname
Expand Down

0 comments on commit d972af8

Please sign in to comment.