1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-02-14 05:50:12 +01:00

fieldtypes, leo: check attr before using method

This commit is contained in:
ArnAud 2016-01-22 15:24:46 +01:00
commit a2cd199f10

View file

@ -32,7 +32,7 @@ class EmFieldType(ReferenceFieldType):
cur_value = int(cur_value)
except (ValueError, TypeError) as e:
raise e # Raise Here !?
if cur_value.is_leobject():
if hasattr(cur_value, 'is_leobject') and cur_value.is_leobject():
# Its an object not populated (we dont now its type)
cur_value = cur_value.lodel_id #Optimize here giving only class_id and type_id to populate ?
if isinstance(cur_value, int):