mirror of
https://github.com/yweber/lodel2.git
synced 2025-11-25 23:06:55 +01:00
Fixes incomplete except in fieldtypes to catch cast fails
This commit is contained in:
parent
801414fcc2
commit
3dea17d7c4
3 changed files with 3 additions and 3 deletions
|
|
@ -20,6 +20,6 @@ class EmFieldType(GenericFieldType):
|
|||
error = None
|
||||
try:
|
||||
value = bool(value)
|
||||
except ValueError:
|
||||
except (ValueError, TypeError):
|
||||
error = TypeError("the value '%s' is not, and will never be a boolean" % value)
|
||||
return (value, error)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ class EmFieldType(GenericFieldType):
|
|||
error = None
|
||||
try:
|
||||
value = int(value)
|
||||
except ValueError:
|
||||
except (ValueError, TypeError):
|
||||
error = TypeError("the value '%s' is not, and will never be an integer" % value)
|
||||
return (value, error)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class EmFieldType(GenericFieldType):
|
|||
# Cast to int
|
||||
try:
|
||||
datas[fname] = int(datas[fname])
|
||||
except ValueError as e:
|
||||
except (ValueError, TypeError) as e:
|
||||
raise e # Raise Here !?
|
||||
if datas[fname].is_leobject():
|
||||
# Its an object not populated (we dont now its type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue