fix(DX): Throw error when unsupported input is sent (#37438)
This commit is contained in:
parent
7eed4a13c3
commit
a16938f455
1 changed files with 4 additions and 0 deletions
|
|
@ -265,6 +265,10 @@ def run_doc_method(method, docs=None, dt=None, dn=None, arg=None, args=None):
|
|||
if dt: # not called from a doctype (from a page)
|
||||
if not dn:
|
||||
dn = dt # single
|
||||
|
||||
if not isinstance(dn, str | int):
|
||||
frappe.throw("'dn' must be a string or an integer")
|
||||
|
||||
doc = frappe.get_doc(dt, dn, check_permission=True)
|
||||
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue