formatting

This commit is contained in:
ben
2022-11-26 02:11:59 +00:00
committed by Vlad Stan
parent 577d5fccd7
commit 879996039f
5 changed files with 13 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ from .helpers import fetch_onchain_balance
from .models import Charges, CreateCharge, SatsPayThemes from .models import Charges, CreateCharge, SatsPayThemes
from loguru import logger from loguru import logger
###############CHARGES########################## ###############CHARGES##########################
@@ -97,7 +98,7 @@ async def update_charge(charge_id: str, **kwargs) -> Optional[Charges]:
async def get_charge(charge_id: str) -> Charges: async def get_charge(charge_id: str) -> Charges:
row = await db.fetchone("SELECT * FROM satspay.charges WHERE id = ?", (charge_id,)) row = await db.fetchone("SELECT * FROM satspay.charges WHERE id = ?", (charge_id,))
return Charges.from_row(row) if row else None 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) return await get_config(row.user)
################## SETTINGS ################### ################## SETTINGS ###################

View File

@@ -75,6 +75,7 @@ class Charges(BaseModel):
def must_call_webhook(self): def must_call_webhook(self):
return self.webhook and self.paid and self.config.webhook_success == False return self.webhook and self.paid and self.config.webhook_success == False
class SatsPayThemes(BaseModel): class SatsPayThemes(BaseModel):
css_id: str = Query(None) css_id: str = Query(None)
title: str = Query(None) title: str = Query(None)

View File

@@ -23,7 +23,11 @@
color="primary" color="primary"
@click="getThemes();formDialogThemes.show = true" @click="getThemes();formDialogThemes.show = true"
>New CSS Theme >New CSS Theme
<q-tooltip>For security reason, custom css is only available to server admins.</q-tooltip></q-btn> <q-tooltip
>For security reason, custom css is only available to server
admins.</q-tooltip
></q-btn
>
</q-card-section> </q-card-section>
</q-card> </q-card>
@@ -276,7 +280,7 @@
</q-card-section> </q-card-section>
</q-card> </q-card>
<q-card v-if="admin == 'True'"> <q-card v-if="admin == 'True'">
<q-card-section> <q-card-section>
<div class="row items-center no-wrap q-mb-md"> <div class="row items-center no-wrap q-mb-md">
<div class="col"> <div class="col">
@@ -949,8 +953,8 @@
}, },
created: async function () { created: async function () {
console.log(this.admin) console.log(this.admin)
if(this.admin == "True"){ if (this.admin == 'True') {
await this.getThemes() await this.getThemes()
} }
await this.getCharges() await this.getCharges()
await this.getWalletConfig() await this.getWalletConfig()

View File

@@ -19,6 +19,7 @@ from loguru import logger
templates = Jinja2Templates(directory="templates") templates = Jinja2Templates(directory="templates")
@satspay_ext.get("/", response_class=HTMLResponse) @satspay_ext.get("/", response_class=HTMLResponse)
async def index(request: Request, user: User = Depends(check_user_exists)): async def index(request: Request, user: User = Depends(check_user_exists)):
admin = False admin = False

View File

@@ -151,7 +151,7 @@ async def api_charge_balance(charge_id):
return {**public_charge(charge)} return {**public_charge(charge)}
#############################THEMES########################## #############################THEMES##########################