Merge pull request #5312 from achillesrasquinha/fixes

Fix in case DocType Not found for cast_singles
This commit is contained in:
Achilles Rasquinha 2018-03-29 14:27:42 +05:30 committed by GitHub
commit bb8bfb647a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,12 +39,15 @@ import pymysql
def _cast_result(doctype, result):
batch = [ ]
for field, value in result:
df = frappe.get_meta(doctype).get_field(field)
if df:
value = cast_fieldtype(df.fieldtype, value)
try:
for field, value in result:
df = frappe.get_meta(doctype).get_field(field)
if df:
value = cast_fieldtype(df.fieldtype, value)
batch.append(tuple([field, value]))
batch.append(tuple([field, value]))
except frappe.exceptions.DoesNotExistError:
return result
return tuple(batch)