fix(crm): check read permission on lead in add_lead_to_prospect

This commit is contained in:
Shllokkk
2026-09-02 13:50:38 +05:30
parent a2071a6fdd
commit 02fcdc0337

View File

@@ -382,6 +382,9 @@ def get_lead_with_phone_number(number):
@frappe.whitelist(methods=["POST"])
def add_lead_to_prospect(lead: str, prospect: str):
if lead:
frappe.has_permission("Lead", "read", lead, throw=True)
prospect = frappe.get_doc("Prospect", prospect)
prospect.append("leads", {"lead": lead})
prospect.save()