From 8f78a67ee1385abff4576461e7ee627ce5f8153c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 3 Oct 2012 16:16:01 +0530 Subject: [PATCH] fixes in data import tool --- core/page/data_import_tool/data_import_tool.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/page/data_import_tool/data_import_tool.py b/core/page/data_import_tool/data_import_tool.py index e45242ee88..e03e639379 100644 --- a/core/page/data_import_tool/data_import_tool.py +++ b/core/page/data_import_tool/data_import_tool.py @@ -201,9 +201,12 @@ def check_record(d, parenttype): if not webnotes.conn.exists(link_doctype, val): raise Exception, "%s must be a valid %s" % (key, link_doctype) else: - if val and ((not docfield.options) or - (val not in docfield.options.split('\n'))): - raise Exception, "%s must be one of:" % key + if val: + if not docfield.options: + raise Exception, "Select options are missing for %s" + elif val not in docfield.options.split('\n'): + raise Exception, "%s must be one of: %s" % \ + (key, ", ".join(docfield.options.split("\n"))) if docfield.fieldtype=='Date' and val: d[key] = user_to_str(val, webnotes.form_dict['date_format'])