Converted views
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
from quart import g, render_template
|
||||
|
||||
from lnbits.decorators import check_user_exists, validate_uuids
|
||||
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from . import example_ext
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.templating import Jinja2Templates
|
||||
|
||||
templates = Jinja2Templates(directory="templates")
|
||||
|
||||
@example_ext.route("/")
|
||||
@validate_uuids(["usr"], required=True)
|
||||
@check_user_exists()
|
||||
async def index():
|
||||
return await render_template("example/index.html", user=g.user)
|
||||
async def index(request: Request):
|
||||
return await templates.TemplateResponse("example/index.html", {"request": request, "user":g.user})
|
||||
|
||||
Reference in New Issue
Block a user