diff --git a/__init__.py b/__init__.py index 502e806..879bc30 100644 --- a/__init__.py +++ b/__init__.py @@ -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 * diff --git a/__pycache__/__init__.cpython-39.pyc b/__pycache__/__init__.cpython-39.pyc index f143f16..4eb254d 100644 Binary files a/__pycache__/__init__.cpython-39.pyc and b/__pycache__/__init__.cpython-39.pyc differ diff --git a/__pycache__/crud.cpython-39.pyc b/__pycache__/crud.cpython-39.pyc index bf52c9c..fd469a1 100644 Binary files a/__pycache__/crud.cpython-39.pyc and b/__pycache__/crud.cpython-39.pyc differ diff --git a/__pycache__/lnurl.cpython-39.pyc b/__pycache__/lnurl.cpython-39.pyc index dbb8dea..8daa7b9 100644 Binary files a/__pycache__/lnurl.cpython-39.pyc and b/__pycache__/lnurl.cpython-39.pyc differ diff --git a/__pycache__/migrations.cpython-39.pyc b/__pycache__/migrations.cpython-39.pyc index d0f5545..9fbe114 100644 Binary files a/__pycache__/migrations.cpython-39.pyc and b/__pycache__/migrations.cpython-39.pyc differ diff --git a/__pycache__/models.cpython-39.pyc b/__pycache__/models.cpython-39.pyc index af244b9..711b944 100644 Binary files a/__pycache__/models.cpython-39.pyc and b/__pycache__/models.cpython-39.pyc differ diff --git a/__pycache__/tasks.cpython-39.pyc b/__pycache__/tasks.cpython-39.pyc index ee5459b..c2a8302 100644 Binary files a/__pycache__/tasks.cpython-39.pyc and b/__pycache__/tasks.cpython-39.pyc differ diff --git a/__pycache__/views.cpython-39.pyc b/__pycache__/views.cpython-39.pyc index bc754c8..1195067 100644 Binary files a/__pycache__/views.cpython-39.pyc and b/__pycache__/views.cpython-39.pyc differ diff --git a/__pycache__/views_api.cpython-39.pyc b/__pycache__/views_api.cpython-39.pyc index 6dfe123..66c302c 100644 Binary files a/__pycache__/views_api.cpython-39.pyc and b/__pycache__/views_api.cpython-39.pyc differ diff --git a/config.json b/config.json index 28382d5..eb94eab 100644 --- a/config.json +++ b/config.json @@ -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" } diff --git a/migrations.py b/migrations.py index 32519a8..c77f42e 100644 --- a/migrations.py +++ b/migrations.py @@ -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; """ ) \ No newline at end of file diff --git a/views.py b/views.py index a050351..b26a391 100644 --- a/views.py +++ b/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, @@ -85,4 +85,4 @@ async def manifest(temp_id: str): "url": "/temp/" + temp_id, } ], - } + } \ No newline at end of file