mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-01 23:53:21 +00:00
refactor: parse native JSON request args in buying/doctype/request_for_quotation/mapper.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints accept native JSON types (list/dict/bool) in addition to JSON strings.
This commit is contained in:
@@ -57,8 +57,7 @@ def make_supplier_quotation_from_rfq(
|
|||||||
# This method is used to make supplier quotation from supplier's portal.
|
# This method is used to make supplier quotation from supplier's portal.
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_supplier_quotation(doc: str | Document | dict):
|
def create_supplier_quotation(doc: str | Document | dict):
|
||||||
if isinstance(doc, str):
|
doc = frappe.parse_json(doc)
|
||||||
doc = json.loads(doc)
|
|
||||||
|
|
||||||
if frappe.session.user not in frappe.get_all(
|
if frappe.session.user not in frappe.get_all(
|
||||||
"Portal User", {"parent": doc.get("supplier")}, pluck="user"
|
"Portal User", {"parent": doc.get("supplier")}, pluck="user"
|
||||||
|
|||||||
Reference in New Issue
Block a user