From 879996039f2908a7a67759822782183288791e0a Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 26 Nov 2022 02:11:59 +0000 Subject: [PATCH] formatting --- lnbits/extensions/satspay/crud.py | 4 ++-- lnbits/extensions/satspay/models.py | 1 + .../extensions/satspay/templates/satspay/index.html | 12 ++++++++---- lnbits/extensions/satspay/views.py | 1 + lnbits/extensions/satspay/views_api.py | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lnbits/extensions/satspay/crud.py b/lnbits/extensions/satspay/crud.py index 092720a3a..bbb269b16 100644 --- a/lnbits/extensions/satspay/crud.py +++ b/lnbits/extensions/satspay/crud.py @@ -13,6 +13,7 @@ from .helpers import fetch_onchain_balance from .models import Charges, CreateCharge, SatsPayThemes from loguru import logger + ###############CHARGES########################## @@ -97,7 +98,7 @@ async def update_charge(charge_id: str, **kwargs) -> Optional[Charges]: async def get_charge(charge_id: str) -> Charges: row = await db.fetchone("SELECT * FROM satspay.charges WHERE id = ?", (charge_id,)) - + return Charges.from_row(row) if row else None @@ -179,7 +180,6 @@ async def get_themes(user_id: str) -> List[SatsPayThemes]: return await get_config(row.user) - ################## SETTINGS ################### diff --git a/lnbits/extensions/satspay/models.py b/lnbits/extensions/satspay/models.py index 4227cabc3..cfb3c7aca 100644 --- a/lnbits/extensions/satspay/models.py +++ b/lnbits/extensions/satspay/models.py @@ -75,6 +75,7 @@ class Charges(BaseModel): def must_call_webhook(self): return self.webhook and self.paid and self.config.webhook_success == False + class SatsPayThemes(BaseModel): css_id: str = Query(None) title: str = Query(None) diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index c3ae76869..a77b444d2 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -23,7 +23,11 @@ color="primary" @click="getThemes();formDialogThemes.show = true" >New CSS Theme - For security reason, custom css is only available to server admins. + For security reason, custom css is only available to server + admins. @@ -276,7 +280,7 @@ - +
@@ -949,8 +953,8 @@ }, created: async function () { console.log(this.admin) - if(this.admin == "True"){ - await this.getThemes() + if (this.admin == 'True') { + await this.getThemes() } await this.getCharges() await this.getWalletConfig() diff --git a/lnbits/extensions/satspay/views.py b/lnbits/extensions/satspay/views.py index dff51fbdb..843e6260c 100644 --- a/lnbits/extensions/satspay/views.py +++ b/lnbits/extensions/satspay/views.py @@ -19,6 +19,7 @@ from loguru import logger templates = Jinja2Templates(directory="templates") + @satspay_ext.get("/", response_class=HTMLResponse) async def index(request: Request, user: User = Depends(check_user_exists)): admin = False diff --git a/lnbits/extensions/satspay/views_api.py b/lnbits/extensions/satspay/views_api.py index 22ae8d12f..d9defa2f3 100644 --- a/lnbits/extensions/satspay/views_api.py +++ b/lnbits/extensions/satspay/views_api.py @@ -151,7 +151,7 @@ async def api_charge_balance(charge_id): return {**public_charge(charge)} - + #############################THEMES##########################