ignore if error comes in eval while mapping

This commit is contained in:
Nabin Hait 2011-08-31 17:25:03 +05:30
parent ae2ce62be3
commit ea0d744b2b

View file

@ -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])