Fixed error where missing image in fetch request caused error in client
This commit is contained in:
parent
c440b66894
commit
2e3e9f9fad
@ -79,6 +79,9 @@ def get_image(identifier):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.get(baseurl + get_url)
|
response = requests.get(baseurl + get_url)
|
||||||
|
if response.status_code != 200:
|
||||||
|
print_response(response)
|
||||||
|
return False
|
||||||
payload = response.json()
|
payload = response.json()
|
||||||
print(payload['id'])
|
print(payload['id'])
|
||||||
print(payload['metadata'])
|
print(payload['metadata'])
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class ImageEndpoint:
|
|||||||
logger.debug('Actual MinIO SHA512: {}'.format(actual_minio_hash))
|
logger.debug('Actual MinIO SHA512: {}'.format(actual_minio_hash))
|
||||||
if stored_hash != actual_minio_hash:
|
if stored_hash != actual_minio_hash:
|
||||||
return JsonResponse('Stored hash does not match generated one! '
|
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 = {
|
payload = {
|
||||||
'id': identifier,
|
'id': identifier,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user