fix: simplify merge condition statement

Co-authored-by: gavin <gavin18d@gmail.com>
This commit is contained in:
Devin Slauenwhite 2021-10-13 11:26:24 -04:00 committed by GitHub
parent 2c9f08997a
commit 12e4b33a1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -471,7 +471,7 @@ def bulk_rename(doctype, rows=None, via_console = False):
for row in rows:
# if row has some content
if len(row) > 1 and row[0] and row[1]:
merge = True if len(row) > 2 and (row[2] == "1" or row[2].lower() == "true") else False
merge = len(row) > 2 and (row[2] == "1" or row[2].lower() == "true")
try:
if rename_doc(doctype, row[0], row[1], merge=merge):
msg = _("Successful: {0} to {1}").format(row[0], row[1])