refactor: parse native JSON request args in projects/doctype/project/project.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:
Mihir Kandoi
2026-06-24 20:37:33 +05:30
parent c1ec503858
commit e432f8284b

View File

@@ -629,11 +629,11 @@ def allow_to_make_project_update(project, time, frequency):
@frappe.whitelist()
def create_duplicate_project(prev_doc: str, project_name: str):
def create_duplicate_project(prev_doc: str | dict, project_name: str):
"""Create duplicate project based on the old project"""
import json
prev_doc = json.loads(prev_doc)
prev_doc = frappe.parse_json(prev_doc)
if project_name == prev_doc.get("name"):
frappe.throw(_("Use a name that is different from previous project name"))