mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-29 22:58:25 +00:00
refactor: parse native JSON request args in manufacturing/doctype/job_card/job_card.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:
@@ -1685,8 +1685,7 @@ class JobCard(Document):
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_time_log(kwargs: str | dict):
|
||||
if isinstance(kwargs, str):
|
||||
kwargs = json.loads(kwargs)
|
||||
kwargs = frappe.parse_json(kwargs)
|
||||
|
||||
kwargs = frappe._dict(kwargs)
|
||||
doc = frappe.get_doc("Job Card", kwargs.job_card_id)
|
||||
@@ -1761,8 +1760,7 @@ def get_job_card_filter_conditions(jc, filters):
|
||||
Replaces the previous raw SQL ``get_filters_cond`` based filtering so that all
|
||||
user supplied values are passed as bound parameters via the query builder.
|
||||
"""
|
||||
if isinstance(filters, str):
|
||||
filters = json.loads(filters)
|
||||
filters = frappe.parse_json(filters)
|
||||
|
||||
if not filters:
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user