Fixed error where missing image in fetch request caused error in client

This commit is contained in:
Martin Schett 2020-12-06 19:41:45 +01:00
parent c440b66894
commit 2e3e9f9fad
2 changed files with 4 additions and 1 deletions

View File

@ -79,6 +79,9 @@ def get_image(identifier):
try:
response = requests.get(baseurl + get_url)
if response.status_code != 200:
print_response(response)
return False
payload = response.json()
print(payload['id'])
print(payload['metadata'])

View File

@ -73,7 +73,7 @@ class ImageEndpoint:
logger.debug('Actual MinIO SHA512: {}'.format(actual_minio_hash))
if stored_hash != actual_minio_hash:
return JsonResponse('Stored hash does not match generated one! '
'stored: {} actual: {}'.format(stored_hash, actual_minio_hash), safe=False)
'stored: {} actual: {}'.format(stored_hash, actual_minio_hash), status=404, safe=False)
payload = {
'id': identifier,