Merge pull request #43643 from Sanket322/ensure_db_before_fetch

fix: check for the existence of a doctype before querying.
This commit is contained in:
ruthra kumar
2024-10-15 16:28:44 +05:30
committed by GitHub

View File

@@ -10,6 +10,8 @@ def execute():
Remove Lead Source doctype and use UTM Source Instead
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")
ms = frappe.qb.DocType("UTM Source")