db wrong name
This commit is contained in:
parent
7b5a2a1e54
commit
ea75373532
12 changed files with 9 additions and 12 deletions
|
|
@ -1,13 +1,10 @@
|
|||
import asyncio
|
||||
|
||||
from fastapi import APIRouter, Request, Response
|
||||
from fastapi.routing import APIRoute
|
||||
from fastapi import APIRouter
|
||||
|
||||
from lnbits.db import Database
|
||||
from lnbits.helpers import template_renderer
|
||||
from lnbits.tasks import catch_everything_and_restart
|
||||
from typing import Callable
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
db = Database("ext_tempextension")
|
||||
|
||||
|
|
@ -22,7 +19,7 @@ temp_static_files = [
|
|||
}
|
||||
]
|
||||
|
||||
def template_renderer():
|
||||
def temp_renderer():
|
||||
return template_renderer(["temp/templates"])
|
||||
|
||||
from .lnurl import *
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "Temp",
|
||||
"short_description": "Minimal extension to build on",
|
||||
"tile": "/tempextension/static/image/temp.png",
|
||||
"tile": "/temp/static/image/temp.png",
|
||||
"contributors": ["arcbtc"],
|
||||
"min_lnbits_version": "0.0.1"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ async def m001_initial(db):
|
|||
"""
|
||||
await db.execute(
|
||||
"""
|
||||
CREATE TABLE tempextension.tempextension (
|
||||
CREATE TABLE tempextension.temp (
|
||||
id TEXT PRIMARY KEY,
|
||||
wallet TEXT NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
|
|
@ -24,6 +24,6 @@ async def m002_addtip_wallet(db):
|
|||
"""
|
||||
await db.execute(
|
||||
"""
|
||||
ALTER TABLE tempextension.tempextension ADD lnurlwithdrawamount INTEGER DEFAULT 0;
|
||||
ALTER TABLE tempextension.temp ADD lnurlwithdrawamount INTEGER DEFAULT 0;
|
||||
"""
|
||||
)
|
||||
6
views.py
6
views.py
|
|
@ -9,7 +9,7 @@ from lnbits.core.models import User
|
|||
from lnbits.decorators import check_user_exists
|
||||
from lnbits.settings import settings
|
||||
|
||||
from . import temp_ext, template_renderer
|
||||
from . import temp_ext, temp_renderer
|
||||
from .crud import get_temp
|
||||
|
||||
temps = Jinja2Templates(directory="temps")
|
||||
|
|
@ -24,7 +24,7 @@ temps = Jinja2Templates(directory="temps")
|
|||
|
||||
@temp_ext.get("/", response_class=HTMLResponse)
|
||||
async def index(request: Request, user: User = Depends(check_user_exists)):
|
||||
return template_renderer().TempResponse(
|
||||
return temp_renderer().TemplateResponse(
|
||||
"temp/index.html", {"request": request, "user": user.dict()}
|
||||
)
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ async def temp(request: Request, temp_id):
|
|||
raise HTTPException(
|
||||
status_code=HTTPStatus.NOT_FOUND, detail="Temp does not exist."
|
||||
)
|
||||
return template_renderer().TempResponse(
|
||||
return temp_renderer().TemplateResponse(
|
||||
"temp/temp.html",
|
||||
{
|
||||
"request": request,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue