From 6e382b0e6e614991b8157602999b90761a30f309 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 12 Feb 2024 22:07:18 +1100 Subject: [PATCH] fix: Niami rating example fail on revealing domain --- plugins/example.py | 2 ++ render.py | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/example.py b/plugins/example.py index a0d2d9d..bcf5cfa 100644 --- a/plugins/example.py +++ b/plugins/example.py @@ -161,6 +161,8 @@ def niami(params, authentication): domain = params["domain"] response = requests.get(f"https://api.handshake.niami.io/domain/{domain}") data = response.json()["data"] + if 'rating' not in data: + return {"rating":"No rating found."} rating = str(data["rating"]["score"]) + " (" + data["rating"]["rarity"] + ")" return {"rating":rating} diff --git a/render.py b/render.py index 22151b3..aa00b46 100644 --- a/render.py +++ b/render.py @@ -66,11 +66,6 @@ def transactions(txs): html += f'{action}{address}{hash}{confirmations}{amount} HNS' - - - - - return html