From 250e5cc020936dba166fd8895dd912a8d1e7a061 Mon Sep 17 00:00:00 2001 From: Arc Date: Mon, 7 Oct 2024 15:57:19 +0100 Subject: [PATCH] some mypy fixes --- views_lnurl.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/views_lnurl.py b/views_lnurl.py index f8c44b0..15c133b 100644 --- a/views_lnurl.py +++ b/views_lnurl.py @@ -88,7 +88,11 @@ async def lnurl_params( # Check they're not trying to trick the switch! check = False - if device.extra and "atm" not in device.extra: + if ( + device.extra + and not isinstance(device.extra, str) + and "atm" not in device.extra + ): for extra in device.extra: if ( extra.pin == int(pin) @@ -143,6 +147,9 @@ async def lnurl_params( if device.currency != "sat" else amount_in_cent ) + if price_msat is None: + return {"status": "ERROR", "reason": "Price fetch error."} + if atm: lnurldevicepayment, price_msat = await register_atm_payment(device, p)