Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions willisapi_client/services/metadata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,15 @@ def __init__(self, row):
def validate_row(self):
if not os.path.exists(self.row.file_path):
return (False, "File path does not exist")
if self.row.language not in LANGUAGE_CHOICES:
return (False, f"Invalid language: {self.row.language}")
language = getattr(self.row, "language", None)
if language and language not in LANGUAGE_CHOICES:
return (False, f"Invalid language: {language}")
return (True, None)

def validate_processed_data_row(self):
if self.row.language not in LANGUAGE_CHOICES:
return (False, f"Invalid language: {self.row.language}")
language = getattr(self.row, "language", None)
if language and language not in LANGUAGE_CHOICES:
return (False, f"Invalid language: {language}")
return (True, None)

def calculate_file_checksum(self, file_path: str) -> str:
Expand Down
Loading