mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-01-18 21:32:38 +01:00
Change _asdict() to dict()
This commit is contained in:
parent
aba206c87e
commit
a00e46f629
@ -50,7 +50,7 @@ async def dispatch_invoice_listener(payment: Payment):
|
|||||||
|
|
||||||
async def dispatch_webhook(payment: Payment):
|
async def dispatch_webhook(payment: Payment):
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
data = payment._asdict()
|
data = payment.dict()
|
||||||
try:
|
try:
|
||||||
r = await client.post(payment.webhook, json=data, timeout=40)
|
r = await client.post(payment.webhook, json=data, timeout=40)
|
||||||
await mark_webhook_sent(payment, r.status_code)
|
await mark_webhook_sent(payment, r.status_code)
|
||||||
|
@ -66,7 +66,7 @@ async def api_link_retrieve(
|
|||||||
detail="Not your pay link.", status_code=HTTPStatus.FORBIDDEN
|
detail="Not your pay link.", status_code=HTTPStatus.FORBIDDEN
|
||||||
)
|
)
|
||||||
|
|
||||||
return {**link._asdict(), **{"lnurl": link.lnurl(r)}}
|
return {**link.dict(), **{"lnurl": link.lnurl(r)}}
|
||||||
|
|
||||||
|
|
||||||
@lnurlp_ext.post("/api/v1/links", status_code=HTTPStatus.CREATED)
|
@lnurlp_ext.post("/api/v1/links", status_code=HTTPStatus.CREATED)
|
||||||
|
@ -173,7 +173,7 @@ async def api_get_donations(g: WalletTypeInfo = Depends(get_key_type)):
|
|||||||
for wallet_id in wallet_ids:
|
for wallet_id in wallet_ids:
|
||||||
new_donations = await get_donations(wallet_id)
|
new_donations = await get_donations(wallet_id)
|
||||||
donations += new_donations if new_donations else []
|
donations += new_donations if new_donations else []
|
||||||
return [donation._asdict() for donation in donations] if donations else []
|
return [donation.dict() for donation in donations] if donations else []
|
||||||
|
|
||||||
|
|
||||||
@streamalerts_ext.put("/api/v1/donations/{donation_id}")
|
@streamalerts_ext.put("/api/v1/donations/{donation_id}")
|
||||||
|
@ -92,7 +92,7 @@ async def api_get_tipjars(wallet: WalletTypeInfo = Depends(get_key_type)):
|
|||||||
for wallet_id in wallet_ids:
|
for wallet_id in wallet_ids:
|
||||||
new_tipjars = await get_tipjars(wallet_id)
|
new_tipjars = await get_tipjars(wallet_id)
|
||||||
tipjars += new_tipjars if new_tipjars else []
|
tipjars += new_tipjars if new_tipjars else []
|
||||||
return [tipjar._asdict() for tipjar in tipjars] if tipjars else []
|
return [tipjar.dict() for tipjar in tipjars] if tipjars else []
|
||||||
|
|
||||||
|
|
||||||
@tipjar_ext.get("/api/v1/tips")
|
@tipjar_ext.get("/api/v1/tips")
|
||||||
@ -103,7 +103,7 @@ async def api_get_tips(wallet: WalletTypeInfo = Depends(get_key_type)):
|
|||||||
for wallet_id in wallet_ids:
|
for wallet_id in wallet_ids:
|
||||||
new_tips = await get_tips(wallet_id)
|
new_tips = await get_tips(wallet_id)
|
||||||
tips += new_tips if new_tips else []
|
tips += new_tips if new_tips else []
|
||||||
return [tip._asdict() for tip in tips] if tips else []
|
return [tip.dict() for tip in tips] if tips else []
|
||||||
|
|
||||||
|
|
||||||
@tipjar_ext.put("/api/v1/tips/{tip_id}")
|
@tipjar_ext.put("/api/v1/tips/{tip_id}")
|
||||||
|
Loading…
Reference in New Issue
Block a user