fix: some errors in lnticket ext
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from quart import g, abort, render_template
|
||||
|
||||
from fastapi.param_functions import Depends
|
||||
from starlette.exceptions import HTTPException
|
||||
from starlette.responses import HTMLResponse
|
||||
from lnbits.core.models import User
|
||||
from lnbits.core.crud import get_wallet
|
||||
from lnbits.decorators import check_user_exists, validate_uuids
|
||||
from lnbits.decorators import check_user_exists
|
||||
from http import HTTPStatus
|
||||
|
||||
from . import lnticket_ext, lnticket_renderer
|
||||
@@ -12,7 +14,9 @@ from fastapi.templating import Jinja2Templates
|
||||
templates = Jinja2Templates(directory="templates")
|
||||
|
||||
@lnticket_ext.get("/", response_class=HTMLResponse)
|
||||
@validate_uuids(["usr"], required=True)
|
||||
# not needed as we automatically get the user with the given ID
|
||||
# If no user with this ID is found, an error is raised
|
||||
# @validate_uuids(["usr"], required=True)
|
||||
# @check_user_exists()
|
||||
async def index(request: Request, user: User = Depends(check_user_exists)):
|
||||
return lnticket_renderer().TemplateResponse("lnticket/index.html", {"request": request,"user": user.dict()})
|
||||
|
||||
Reference in New Issue
Block a user