mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-21 18:29:57 +00:00
refactor: parse native JSON request args in regional/report/irs_1099/irs_1099.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:
@@ -84,7 +84,7 @@ def get_columns():
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def irs_1099_print(filters: str):
|
||||
def irs_1099_print(filters: str | dict):
|
||||
if not filters:
|
||||
frappe._dict(
|
||||
{
|
||||
@@ -93,7 +93,7 @@ def irs_1099_print(filters: str):
|
||||
}
|
||||
)
|
||||
else:
|
||||
filters = frappe._dict(json.loads(filters))
|
||||
filters = frappe._dict(frappe.parse_json(filters))
|
||||
|
||||
fiscal_year_doc = get_fiscal_year(fiscal_year=filters.fiscal_year, as_dict=True)
|
||||
fiscal_year = cstr(fiscal_year_doc.year_start_date.year)
|
||||
|
||||
Reference in New Issue
Block a user