fix mypy for lnbits/extensions/paywall

This commit is contained in:
Pavol Rusnak 2023-01-03 23:21:17 +01:00
parent c9b02a6470
commit 236fe9f8eb
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 5 additions and 2 deletions

View File

@ -19,7 +19,8 @@ async def api_paywalls(
wallet_ids = [wallet.wallet.id]
if all_wallets:
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
user = await get_user(wallet.wallet.user)
wallet_ids = user.wallet_ids if user else []
return [paywall.dict() for paywall in await get_paywalls(wallet_ids)]
@ -57,6 +58,7 @@ async def api_paywall_create_invoice(
data: CreatePaywallInvoice, paywall_id: str = Query(None)
):
paywall = await get_paywall(paywall_id)
assert paywall
if data.amount < paywall.amount:
raise HTTPException(
status_code=HTTPStatus.BAD_REQUEST,
@ -94,7 +96,9 @@ async def api_paywal_check_invoice(
if is_paid:
wallet = await get_wallet(paywall.wallet)
assert wallet
payment = await wallet.get_payment(payment_hash)
assert payment
await payment.set_pending(False)
return {"paid": True, "url": paywall.url, "remembers": paywall.remembers}

View File

@ -102,7 +102,6 @@ exclude = """(?x)(
| ^lnbits/extensions/lnurldevice.
| ^lnbits/extensions/lnurlp.
| ^lnbits/extensions/offlineshop.
| ^lnbits/extensions/paywall.
| ^lnbits/extensions/satspay.
| ^lnbits/extensions/splitpayments.
| ^lnbits/extensions/streamalerts.