From ea0d744b2b7c71cdbce5b95469c8f54bdb8bf92f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 31 Aug 2011 17:25:03 +0530 Subject: [PATCH] ignore if error comes in eval while mapping --- cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py b/cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py index 89cf74efae..05b136de11 100644 --- a/cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py +++ b/cgi-bin/core/doctype/doctype_mapper/doctype_mapper.py @@ -143,7 +143,12 @@ class DocType: for f in fld_list: if f[2] == 'Yes': if f[0].startswith('eval:'): - to_doc.fields[f[1]] = eval(f[0][5:]) + try: + val = eval(f[0][5:]) + except: + val = '' + + to_doc.fields[f[1]] = val else: to_doc.fields[f[1]] = obj.fields.get(f[0])