fix: set correct document label in case doc is of type str
This commit is contained in:
parent
8f7a4f6697
commit
29e5ad4fca
1 changed files with 3 additions and 1 deletions
|
|
@ -985,7 +985,9 @@ def has_permission(
|
|||
|
||||
if throw and not out:
|
||||
# mimics frappe.throw
|
||||
document_label = f"{_(doc.doctype)} {doc.name}" if doc else _(doctype)
|
||||
document_label = (
|
||||
f"{_(doctype)} {doc if isinstance(doc, str) else doc.name}" if doc else _(doctype)
|
||||
)
|
||||
msgprint(
|
||||
_("No permission for {0}").format(document_label),
|
||||
raise_exception=ValidationError,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue