fix scrub for mypy

This commit is contained in:
dni ⚡
2023-01-02 11:25:01 +01:00
parent 765fd892bf
commit 3824a108aa
4 changed files with 8 additions and 13 deletions
+4 -7
View File
@@ -1,9 +1,6 @@
from http import HTTPStatus
from fastapi import Request
from fastapi.param_functions import Query
from fastapi.params import Depends
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl # type: ignore
from fastapi import Query, Depends
from starlette.exceptions import HTTPException
from lnbits.core.crud import get_user
@@ -23,14 +20,14 @@ from .models import CreateScrubLink
@scrub_ext.get("/api/v1/links", status_code=HTTPStatus.OK)
async def api_links(
req: Request,
wallet: WalletTypeInfo = Depends(get_key_type),
all_wallets: bool = Query(False),
):
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 []
try:
return [link.dict() for link in await get_scrub_links(wallet_ids)]
@@ -44,7 +41,7 @@ async def api_links(
@scrub_ext.get("/api/v1/links/{link_id}", status_code=HTTPStatus.OK)
async def api_link_retrieve(
r: Request, link_id, wallet: WalletTypeInfo = Depends(get_key_type)
link_id, wallet: WalletTypeInfo = Depends(get_key_type)
):
link = await get_scrub_link(link_id)