fix: check for existence of doctype before querying

This commit is contained in:
Sanket322
2024-10-14 12:25:32 +05:30
parent 2fc4f86191
commit 48ed12bdd7

View File

@@ -10,6 +10,8 @@ def execute():
Remove Lead Source doctype and use UTM Source Instead Remove Lead Source doctype and use UTM Source Instead
Ensure that for each Campaign, a UTM Campaign is also set Ensure that for each Campaign, a UTM Campaign is also set
""" """
if not frappe.db.exists("DocType", "Lead Source") or not frappe.db.exists("DocType", "UTM Source"):
return
ls = frappe.qb.DocType("Lead Source") ls = frappe.qb.DocType("Lead Source")
ms = frappe.qb.DocType("UTM Source") ms = frappe.qb.DocType("UTM Source")