fix: converted query to qb

This commit is contained in:
Jannat Patel
2023-01-04 16:57:35 +05:30
parent ec31c96120
commit 281af15d65

View File

@@ -2,9 +2,9 @@ import frappe
def execute(): def execute():
rows = frappe.db.sql( table = frappe.qb.DocType("Singles")
"select field from `tabSingles` where doctype='User'", as_dict=True q = frappe.qb.from_(table).select(table.field).where(table.doctype == "User")
) rows = q.run()
if len(rows): if len(rows):
frappe.db.sql("delete from `tabSingles` where doctype='User'") frappe.db.delete("Singles", {"doctype": "User"})