mirror of https://gitlab.com/openlp/openlp.git
Merge branch 'delete_presentation_from_controller_when_permission_error' into 'master'
When a permission error is raised during generation of the sha256 hash when deleting a presentation from the controller don't crash but continue. See merge request openlp/openlp!646
This commit is contained in:
commit
35e12309e5
|
@ -157,7 +157,7 @@ class PresentationDocument(object):
|
||||||
else:
|
else:
|
||||||
self._sha256_file_hash = sha256_file_hash(self.file_path)
|
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
|
# 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
|
folder = self._sha256_file_hash or self.file_path.name
|
||||||
else:
|
else:
|
||||||
folder = self.file_path.name
|
folder = self.file_path.name
|
||||||
|
@ -179,7 +179,9 @@ class PresentationDocument(object):
|
||||||
folder = self._sha256_file_hash
|
folder = self._sha256_file_hash
|
||||||
else:
|
else:
|
||||||
self._sha256_file_hash = sha256_file_hash(self.file_path)
|
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:
|
else:
|
||||||
folder = self.file_path.name
|
folder = self.file_path.name
|
||||||
return Path(self.controller.temp_folder, folder)
|
return Path(self.controller.temp_folder, folder)
|
||||||
|
|
Loading…
Reference in New Issue