Fix satoshi quotes bug

This commit is contained in:
Black Coffee 2022-10-02 11:25:07 +01:00
parent 01681c3af2
commit 1f660d6694

View file

@ -91,7 +91,7 @@ async def api_gerty_delete(
async def api_gerty_satoshi(): async def api_gerty_satoshi():
with open(os.path.join(LNBITS_PATH, 'extensions/gerty/static/satoshi.json')) as fd: with open(os.path.join(LNBITS_PATH, 'extensions/gerty/static/satoshi.json')) as fd:
satoshiQuotes = json.load(fd) satoshiQuotes = json.load(fd)
return satoshiQuotes[random.randint(0, 100)] return satoshiQuotes[random.randint(0, len(satoshiQuotes) - 1)]
@gerty_ext.get("/api/v1/gerty/pieterwielliequote", status_code=HTTPStatus.OK) @gerty_ext.get("/api/v1/gerty/pieterwielliequote", status_code=HTTPStatus.OK)