mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 15:11:52 +00:00
refactor: parse native JSON request args in projects/doctype/timesheet/timesheet.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:
@@ -497,7 +497,7 @@ def get_activity_cost(
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_events(start: str, end: str, filters: str | None = None):
|
||||
def get_events(start: str, end: str, filters: str | dict | None = None):
|
||||
"""Returns events for Gantt / Calendar view rendering.
|
||||
:param start: Start date-time.
|
||||
:param end: End date-time.
|
||||
@@ -505,7 +505,7 @@ def get_events(start: str, end: str, filters: str | None = None):
|
||||
"""
|
||||
from erpnext.utilities.query import get_event_conditions_qb
|
||||
|
||||
filters = json.loads(filters) if filters else {}
|
||||
filters = frappe.parse_json(filters) if filters else {}
|
||||
|
||||
tsd = frappe.qb.DocType("Timesheet Detail")
|
||||
ts = frappe.qb.DocType("Timesheet")
|
||||
|
||||
Reference in New Issue
Block a user