ignore if error comes in eval while mapping
This commit is contained in:
parent
ae2ce62be3
commit
ea0d744b2b
1 changed files with 6 additions and 1 deletions
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue