Return None on 404

This commit is contained in:
Tobias Eidelpes 2021-01-08 13:13:01 +01:00
parent 6ad99561e7
commit 27b4f50f69

View File

@ -84,6 +84,8 @@ class MinioService(StorageServiceInterface):
try:
url = settings.AWS_HOST + filename
response = requests.get(url, stream=True)
if response.status_code == 404:
return file_bytes
file_bytes = response.content
except:
print("Error downloading file from minio")