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

(cherry picked from commit 5cef8db4db)

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2020-05-21 18:57:24 +05:30
committed by GitHub
parent 4c779300fd
commit 030abc14a4

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)), ))