From af2af54cd2944b9c03c88f12d757cd45e30d0551 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 13 Sep 2011 15:45:03 +0530 Subject: [PATCH] show validation message --- cgi-bin/webnotes/model/import_docs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cgi-bin/webnotes/model/import_docs.py b/cgi-bin/webnotes/model/import_docs.py index 524462c35b..8ea1502d82 100644 --- a/cgi-bin/webnotes/model/import_docs.py +++ b/cgi-bin/webnotes/model/import_docs.py @@ -291,6 +291,7 @@ class CSVImport: cur_doc = Document(fielddata = fd) cur_doc.doctype, cur_doc.parenttype, cur_doc.parentfield = self.dt_list[0], len(self.dt_list) > 1 and self.dt_list[1] or '', len(self.dt_list) > 1 and self.dt_list[2] or '' obj = '' + webnotes.message_log = [] # save the document try: if webnotes.conn.in_transaction: @@ -321,7 +322,8 @@ class CSVImport: except Exception: sql("ROLLBACK") - self.msg.append('
Validation: %s
' % str(webnotes.message_log[-1:])) + self.msg.append('
Validation Error: %s
' % str((webnotes.message_log and webnotes.message_log[0]) or webnotes.utils.getTraceback())) + self.msg.append('
Did not import
' # do import # --------------------------------------------------------------------