Skip to content
Permalink
Browse files
In remote API exists(), handle case where data product itself doesn…
…'t exist
  • Loading branch information
machristie committed May 6, 2021
1 parent b840ef0 commit 76f44b10de186bab00e1a80f4b39633b3af9c864
Showing 1 changed file with 5 additions and 1 deletion.
@@ -248,7 +248,11 @@ def exists(request, data_product=None, data_product_uri=None):
resp = _call_remote_api(
request,
"/data-products/",
params={'product-uri': data_product.productUri})
params={'product-uri': data_product.productUri},
raise_for_status=False)
if resp.status_code == HTTPStatus.NOT_FOUND:
return False
resp.raise_for_status()
data = resp.json()
return data['downloadURL'] is not None
else:

0 comments on commit 76f44b1

Please sign in to comment.