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

(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:42 +05:30 committed by GitHub
parent 630050411f
commit 54bcda42ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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