fix: some errors in lnticket ext

This commit is contained in:
Stefan Stammberger
2021-09-28 21:18:15 +02:00
parent 2a4314ca84
commit 85d9a3fcc3
6 changed files with 57 additions and 59 deletions
+8 -4
View File
@@ -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()})