fix(patch): Handle single value in patch (#21823)

This commit is contained in:
Suraj Shetty
2020-05-21 14:32:24 +05:30
committed by GitHub
parent c43932e653
commit 5cef8db4db

View File

@@ -40,5 +40,5 @@ def get_duplicate_records():
def delete_duplicate_ledger_entries(duplicate_records_list):
"""Delete duplicate leave ledger entries."""
if duplicate_records_list:
frappe.db.sql(''' DELETE FROM `tabLeave Ledger Entry` WHERE name in {0}'''.format(tuple(duplicate_records_list))) #nosec
if not duplicate_records_list: return
frappe.db.sql('''DELETE FROM `tabLeave Ledger Entry` WHERE name in %s''', ((tuple(duplicate_records_list)), ))