Merge pull request #51123 from ruthra-kumar/fix_security_issue_in_payment_request

fix: ensure type on method parameter
This commit is contained in:
ruthra kumar
2025-12-16 15:33:10 +05:30
committed by GitHub

View File

@@ -539,6 +539,9 @@ def make_payment_request(**args):
if args.dt not in ALLOWED_DOCTYPES_FOR_PAYMENT_REQUEST:
frappe.throw(_("Payment Requests cannot be created against: {0}").format(frappe.bold(args.dt)))
if args.dn and not isinstance(args.dn, str):
frappe.throw(_("Invalid parameter. 'dn' should be of type str"))
ref_doc = args.ref_doc or frappe.get_doc(args.dt, args.dn)
if not args.get("company"):
args.company = ref_doc.company