diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py index 38c1349067fce68dc3dc0311dc621bd0e383d4b0..4d7798d4c6adfc829ec133567bcebeb58fa87633 100644 --- a/src/linkahead/common/models.py +++ b/src/linkahead/common/models.py @@ -63,8 +63,7 @@ from ..exceptions import (AmbiguousEntityError, AuthorizationError, UniqueNamesError, UnqualifiedParentsError, UnqualifiedPropertiesError) from .datatype import (BOOLEAN, DATETIME, DOUBLE, INTEGER, TEXT, - get_list_datatype, - is_list_datatype, is_reference) + get_list_datatype, is_list_datatype, is_reference) from .state import State from .timezone import TimeZone from .utils import uuid, xml2str @@ -1503,7 +1502,12 @@ def _parse_value(datatype, value): return float(value) if datatype == INTEGER: - return int(str(value)) + if isinstance(value, int): + return value + elif isinstance(value, float): + return int(value) + else: + return int(str(value)) if datatype == BOOLEAN: if str(value).lower() == "true":