Browse Source

fieldtypes, leo: check attr before using method

ArnAud 9 years ago
parent
commit
a2cd199f10
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      EditorialModel/fieldtypes/leo.py

+ 1
- 1
EditorialModel/fieldtypes/leo.py View File

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

Loading…
Cancel
Save