lnbits-legend/lnbits/extensions/splitpayments/views.py
2021-10-18 19:39:35 +01:00

19 lines
622 B
Python

from fastapi import Request
from fastapi.params import Depends
from fastapi.templating import Jinja2Templates
from starlette.responses import HTMLResponse
from lnbits.core.models import User
from lnbits.decorators import check_user_exists
from . import splitpayments_ext, splitpayments_renderer
templates = Jinja2Templates(directory="templates")
@splitpayments_ext.get("/", response_class=HTMLResponse)
async def index(request: Request, user: User = Depends(check_user_exists)):
return splitpayments_renderer().TemplateResponse(
"splitpayments/index.html", {"request": request, "user": user.dict()}
)