Skip to content

Commit

Permalink
add valid conditional to fileinternal
Browse files Browse the repository at this point in the history
  • Loading branch information
nevoodoo committed Feb 26, 2024
1 parent afa6778 commit e6a79f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion models/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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):
Expand Down

0 comments on commit e6a79f4

Please sign in to comment.