From e6a79f42f78abbba459081fa8dc971551d7099e9 Mon Sep 17 00:00:00 2001 From: Yash Pankhania Date: Mon, 26 Feb 2024 22:36:00 +1100 Subject: [PATCH] add valid conditional to fileinternal --- models/models/file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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):