diff --git a/models/models/file.py b/models/models/file.py index 3467c11e6..31148039d 100644 --- a/models/models/file.py +++ b/models/models/file.py @@ -27,6 +27,7 @@ def from_db(**kwargs): """ Convert from db keys, mainly converting id to id_ """ + valid = kwargs.get('valid') if kwargs.get('valid') in (True, False) else False return FileInternal( id=kwargs.pop('id'), path=kwargs.get('path'), @@ -37,7 +38,7 @@ def from_db(**kwargs): file_checksum=kwargs.get('file_checksum'), size=kwargs.get('size'), meta=kwargs.get('meta'), - valid=kwargs.get('valid', False), + valid=valid, ) def to_external(self):