From ce3296fc87298466c32b6de471d9b1f78aa31ccc Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 29 Apr 2013 12:28:19 +0530 Subject: [PATCH] [rename tool] [fix] condition to validate that content exists in a row of the uploaded file --- utilities/doctype/rename_tool/rename_tool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utilities/doctype/rename_tool/rename_tool.py b/utilities/doctype/rename_tool/rename_tool.py index 2e368ced70..5accf3c6b7 100644 --- a/utilities/doctype/rename_tool/rename_tool.py +++ b/utilities/doctype/rename_tool/rename_tool.py @@ -34,7 +34,8 @@ def upload(select_doctype=None, rows=None): rename_log = [] for row in rows: - if len(row) > 2: + # if row has some content + if len(row) > 1 and row[0] and row[1]: try: if rename_doc(select_doctype, row[0], row[1]): rename_log.append(_("Successful: ") + row[0] + " -> " + row[1]) @@ -45,5 +46,5 @@ def upload(select_doctype=None, rows=None): rename_log.append("" + \ _("Failed: ") + row[0] + " -> " + row[1] + "") rename_log.append("" + repr(e) + "") - + return rename_log \ No newline at end of file