When a permission error is raised during generation of the sha256 hash when deleting a presentation from the controller don't crash but continue.

This commit is contained in:
Chris Witterholt 2023-08-13 21:54:39 +00:00 committed by Raoul Snyman
parent 2fb1085a00
commit bbcea34498
1 changed files with 4 additions and 2 deletions

View File

@ -156,7 +156,7 @@ class PresentationDocument(object):
else:
self._sha256_file_hash = sha256_file_hash(self.file_path)
# If the sha256_file_hash() function encounters an error, it will return None, so use the
# filename as the thumbnail folder if the result is None (or falsey)
# filename as the thumbnail folder if the result is None (or falsey).
folder = self._sha256_file_hash or self.file_path.name
else:
folder = self.file_path.name
@ -178,7 +178,9 @@ class PresentationDocument(object):
folder = self._sha256_file_hash
else:
self._sha256_file_hash = sha256_file_hash(self.file_path)
folder = self._sha256_file_hash
# If the sha256_file_hash() function encounters an error, it will return None, so use the
# filename as the temp folder if the result is None (or falsey).
folder = self._sha256_file_hash or self.file_path.name
else:
folder = self.file_path.name
return Path(self.controller.temp_folder, folder)