Chore, applied black

This commit is contained in:
benarc
2021-11-26 05:58:20 +00:00
parent cfac70d394
commit 56397026c8
30 changed files with 143 additions and 159 deletions
+1 -4
View File
@@ -15,10 +15,7 @@ withdraw_static_files = [
]
withdraw_ext: APIRouter = APIRouter(
prefix="/withdraw",
tags=["withdraw"],
)
withdraw_ext: APIRouter = APIRouter(prefix="/withdraw", tags=["withdraw"])
def withdraw_renderer():
+6 -14
View File
@@ -28,12 +28,9 @@ async def api_lnurl_response(request: Request, unique_hash):
raise HTTPException(
status_code=HTTPStatus.NOT_FOUND, detail="Withdraw link does not exist."
)
if link.is_spent:
raise HTTPException(
detail="Withdraw is spent."
)
raise HTTPException(detail="Withdraw is spent.")
url = request.url_for("withdraw.api_lnurl_callback", unique_hash=link.unique_hash)
withdrawResponse = {
"tag": "withdrawRequest",
@@ -48,15 +45,10 @@ async def api_lnurl_response(request: Request, unique_hash):
# CALLBACK
@withdraw_ext.get(
"/api/v1/lnurl/cb/{unique_hash}",
name="withdraw.api_lnurl_callback",
)
@withdraw_ext.get("/api/v1/lnurl/cb/{unique_hash}", name="withdraw.api_lnurl_callback")
async def api_lnurl_callback(
unique_hash,
request: Request,
k1: str = Query(...),
pr: str = Query(...)
unique_hash, request: Request, k1: str = Query(...), pr: str = Query(...)
):
link = await get_withdraw_link_by_hash(unique_hash)
now = int(datetime.now().timestamp())
@@ -94,8 +86,8 @@ async def api_lnurl_callback(
"usescsv": usescsv,
}
await update_withdraw_link(link.id, **changes)
payment_request=pr
payment_request = pr
await pay_invoice(
wallet_id=link.wallet,
+1 -1
View File
@@ -98,7 +98,7 @@ async def print_qr(request: Request, link_id):
count = count + 1
page_link = list(chunks(links, 2))
linked = list(chunks(page_link, 5))
return withdraw_renderer().TemplateResponse(
"withdraw/print_qr.html", {"request": request, "link": linked, "unique": True}
)