From 2e26fcd5d9756eae9da3682cfab08d67181d16ac Mon Sep 17 00:00:00 2001 From: brucedonovan Date: Mon, 18 Sep 2023 09:12:24 +0100 Subject: [PATCH] chcekuser --- integrations/center.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integrations/center.py b/integrations/center.py index 2dafca4..45af792 100644 --- a/integrations/center.py +++ b/integrations/center.py @@ -701,10 +701,12 @@ def _fetch_nft_asset_price_str(network: str, address: str, token_id: str) -> Opt @auth.authenticate_user_id() def fetch_center_image(response, network: str, address: str, token_id: str, size: str, user_id:str=None): - # TODO check if user is authenticated url = f"{API_URL}/v2/{network}/{address}/nft/{token_id}/render/{size}" resp = requests.get(url, headers=HEADERS) + # Check if user is authenticated + if not user_id: return None + # return response.content if resp.status_code != 200: # Handle error appropriately, return a message, or another status code