fix: improve permission error message (#28292)
This commit is contained in:
parent
e8d9bd39c7
commit
69a8a362f6
1 changed files with 6 additions and 2 deletions
|
|
@ -328,8 +328,12 @@ class Document(BaseDocument, DocRef):
|
|||
|
||||
def raise_no_permission_to(self, perm_type):
|
||||
"""Raise `frappe.PermissionError`."""
|
||||
frappe.flags.error_message = (
|
||||
_("Insufficient Permission for {0}").format(_(self.doctype)) + f" ({frappe.bold(_(perm_type))})"
|
||||
frappe.flags.error_message = _(
|
||||
"You need the '{0}' permission on {1} {2} to perform this action."
|
||||
).format(
|
||||
_(perm_type),
|
||||
frappe.bold(_(self.doctype)),
|
||||
self.name or "",
|
||||
)
|
||||
raise frappe.PermissionError
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue