formatting

This commit is contained in:
dni ⚡ 2022-12-30 09:48:52 +01:00
parent 4b388475ce
commit bb8e86addf
3 changed files with 12 additions and 5 deletions

View file

@ -45,7 +45,7 @@ async def create_tipjar(data: createTipJar) -> TipJar:
""",
(data.name, data.wallet, data.webhook, data.onchain),
)
row = await db.fetchone( "SELECT * FROM tipjar.TipJars LIMIT 1")
row = await db.fetchone("SELECT * FROM tipjar.TipJars LIMIT 1")
tipjar = TipJar(**row)
assert tipjar
return tipjar

View file

@ -1,6 +1,6 @@
from http import HTTPStatus
from fastapi import Request, Depends
from fastapi import Depends, Request
from fastapi.param_functions import Query
from fastapi.templating import Jinja2Templates
from starlette.exceptions import HTTPException

View file

@ -22,7 +22,7 @@ from .crud import (
update_tipjar,
)
from .helpers import get_charge_details
from .models import createTipJar, createTip, createTips
from .models import createTip, createTipJar, createTips
@tipjar_ext.post("/api/v1/tipjars")
@ -116,7 +116,11 @@ async def api_get_tips(wallet: WalletTypeInfo = Depends(get_key_type)):
@tipjar_ext.put("/api/v1/tips/{tip_id}")
async def api_update_tip(data: createTip, wallet: WalletTypeInfo = Depends(get_key_type), tip_id: str = Query(None)):
async def api_update_tip(
data: createTip,
wallet: WalletTypeInfo = Depends(get_key_type),
tip_id: str = Query(None),
):
"""Update a tip with the data given in the request"""
if tip_id:
tip = await get_tip(tip_id)
@ -141,7 +145,10 @@ async def api_update_tip(data: createTip, wallet: WalletTypeInfo = Depends(get_k
@tipjar_ext.put("/api/v1/tipjars/{tipjar_id}")
async def api_update_tipjar(data: createTipJar, wallet: WalletTypeInfo = Depends(get_key_type), tipjar_id: int = Query(None)
async def api_update_tipjar(
data: createTipJar,
wallet: WalletTypeInfo = Depends(get_key_type),
tipjar_id: int = Query(None),
):
"""Update a tipjar with the data given in the request"""
if tipjar_id: