瀏覽代碼

fix: Convert only as_dict and debug values to bool

Given the scope of its usage at this point, this becomes a problem when you'd have a field named y,n, true, false and order_by that field, or have the same values for a document name that parent parameter would accept out of all those that Frappe REST allows.
version-14
Gavin D'souza 4 年之前
父節點
當前提交
b215921a97
共有 1 個檔案被更改,包括 5 行新增4 行删除
  1. +5
    -4
      frappe/api.py

+ 5
- 4
frappe/api.py 查看文件

@@ -119,10 +119,11 @@ def handle():
frappe.local.form_dict.limit or frappe.local.form_dict.limit_page_length or 20,
)

# convert strings to native types
frappe.local.form_dict.update(
{x: sbool(y) for x, y in frappe.local.form_dict.items()}
)
# convert strings to native types - only as_dict and debug accept bool
for param in ["as_dict", "debug"]:
param_val = frappe.local.form_dict.get(param)
if param_val is not None:
frappe.local.form_dict[param] = sbool(param_val)

# evaluate frappe.get_list
data = frappe.call(frappe.client.get_list, doctype, **frappe.local.form_dict)


Loading…
取消
儲存