mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-26 03:46:17 +02:00
tickets fastAPI fixes
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
from quart import g, abort, render_template
|
|
||||||
|
|
||||||
from lnbits.core.crud import get_wallet
|
from lnbits.core.crud import get_wallet
|
||||||
from lnbits.decorators import check_user_exists, validate_uuids
|
from lnbits.decorators import check_user_exists, validate_uuids
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
@@ -7,6 +5,7 @@ from http import HTTPStatus
|
|||||||
from . import lnticket_ext, lnticket_renderer
|
from . import lnticket_ext, lnticket_renderer
|
||||||
from .crud import get_form
|
from .crud import get_form
|
||||||
from fastapi import FastAPI, Request
|
from fastapi import FastAPI, Request
|
||||||
|
from fastapi.params import Depends
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
|
|
||||||
templates = Jinja2Templates(directory="templates")
|
templates = Jinja2Templates(directory="templates")
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import re
|
import re
|
||||||
from quart import g, jsonify, request
|
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
from fastapi import FastAPI, Query
|
from fastapi import FastAPI, Query
|
||||||
@@ -38,7 +37,7 @@ from .crud import (
|
|||||||
async def api_forms(r: Request, wallet: WalletTypeInfo = Depends(get_key_type)):
|
async def api_forms(r: Request, wallet: WalletTypeInfo = Depends(get_key_type)):
|
||||||
wallet_ids = [wallet.wallet.id]
|
wallet_ids = [wallet.wallet.id]
|
||||||
|
|
||||||
if "all_wallets" in r.args:
|
if "all_wallets" in r.path_parameters:
|
||||||
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
|
wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user