This commit is contained in:
dni 2022-07-25 13:30:45 +02:00
parent 3d1abfa35a
commit 5779243d3e
3 changed files with 15 additions and 16 deletions

View File

@ -261,7 +261,7 @@ async def api_payments_pay_invoice(bolt11: str, wallet: Wallet):
)
async def api_payments_create(
wallet: WalletTypeInfo = Depends(require_invoice_key),
invoiceData: CreateInvoiceData = Body(...), #type: ignore
invoiceData: CreateInvoiceData = Body(...), # type: ignore
):
if invoiceData.out is True and wallet.wallet_type == 0:
if not invoiceData.bolt11:

View File

@ -55,9 +55,9 @@ async def home(request: Request, lightning: str = None):
)
async def extensions(
request: Request,
user: User = Depends(check_user_exists), #type: ignore
enable: str = Query(None), #type: ignore
disable: str = Query(None), #type: ignore
user: User = Depends(check_user_exists), # type: ignore
enable: str = Query(None), # type: ignore
disable: str = Query(None), # type: ignore
):
extension_to_enable = enable
extension_to_disable = disable
@ -88,7 +88,7 @@ async def extensions(
# Update user as his extensions have been updated
if extension_to_enable or extension_to_disable:
user = await get_user(user.id) #type: ignore
user = await get_user(user.id) # type: ignore
return template_renderer().TemplateResponse(
"core/extensions.html", {"request": request, "user": user.dict()}
@ -108,12 +108,11 @@ just **user_id**: return the first user wallet or create one if none found (with
nothing: create everything<br>
""",
)
async def wallet(
request: Request = Query(None), #type: ignore
nme: Optional[str] = Query(None), #type: ignore
usr: Optional[UUID4] = Query(None), #type: ignore
wal: Optional[UUID4] = Query(None), #type: ignore
request: Request = Query(None), # type: ignore
nme: Optional[str] = Query(None), # type: ignore
usr: Optional[UUID4] = Query(None), # type: ignore
wal: Optional[UUID4] = Query(None), # type: ignore
):
user_id = usr.hex if usr else None
wallet_id = wal.hex if wal else None

View File

@ -122,8 +122,8 @@ api_key_query = APIKeyQuery(
async def get_key_type(
r: Request,
api_key_header: str = Security(api_key_header), #type: ignore
api_key_query: str = Security(api_key_query) #type: ignore
api_key_header: str = Security(api_key_header), # type: ignore
api_key_query: str = Security(api_key_query), # type: ignore
) -> WalletTypeInfo:
# 0: admin
# 1: invoice
@ -180,8 +180,8 @@ async def get_key_type(
async def require_admin_key(
r: Request,
api_key_header: str = Security(api_key_header), #type: ignore
api_key_query: str = Security(api_key_query) #type: ignore
api_key_header: str = Security(api_key_header), # type: ignore
api_key_query: str = Security(api_key_query), # type: ignore
):
token = api_key_header if api_key_header else api_key_query
@ -199,8 +199,8 @@ async def require_admin_key(
async def require_invoice_key(
r: Request,
api_key_header: str = Security(api_key_header), #type: ignore
api_key_query: str = Security(api_key_query) #type: ignore
api_key_header: str = Security(api_key_header), # type: ignore
api_key_query: str = Security(api_key_query), # type: ignore
):
token = api_key_header if api_key_header else api_key_query