workflows: do not let missing document models fail grep command (#80395) #604

Merged
fpeters merged 1 commits from wip/80395-scan-missing-documents into main 2023-11-24 16:15:49 +01:00
1 changed files with 4 additions and 1 deletions

View File

@ -834,7 +834,10 @@ class ExportToModel(WorkflowStatusItem):
yield from super().get_computed_strings()
yield self.filename
if self.model_file:
kind = self.model_file_validation(self.model_file)
try:
kind = self.model_file_validation(self.model_file)
except FileNotFoundError:
Review

Est-ce qu’on attraperait pas aussi UploadValidationError pour ne pas planter le grep en cas d’upload foireux ?

Est-ce qu’on attraperait pas aussi `UploadValidationError` pour ne pas planter le grep en cas d’upload foireux ?
kind = None
if kind in ('rtf', 'xml'):
yield self.model_file.get_file().read().decode(errors='surrogateescape')
elif kind == 'opendocument':