diff --git a/lnbits/core/tasks.py b/lnbits/core/tasks.py index 9b5adcead..1e3eaeab1 100644 --- a/lnbits/core/tasks.py +++ b/lnbits/core/tasks.py @@ -50,7 +50,7 @@ async def dispatch_invoice_listener(payment: Payment): async def dispatch_webhook(payment: Payment): async with httpx.AsyncClient() as client: - data = payment._asdict() + data = payment.dict() try: r = await client.post(payment.webhook, json=data, timeout=40) await mark_webhook_sent(payment, r.status_code) diff --git a/lnbits/extensions/lnurlp/views_api.py b/lnbits/extensions/lnurlp/views_api.py index da75195f0..cf8969306 100644 --- a/lnbits/extensions/lnurlp/views_api.py +++ b/lnbits/extensions/lnurlp/views_api.py @@ -66,7 +66,7 @@ async def api_link_retrieve( 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) diff --git a/lnbits/extensions/streamalerts/views_api.py b/lnbits/extensions/streamalerts/views_api.py index a4267e910..e19abd731 100644 --- a/lnbits/extensions/streamalerts/views_api.py +++ b/lnbits/extensions/streamalerts/views_api.py @@ -173,7 +173,7 @@ async def api_get_donations(g: WalletTypeInfo = Depends(get_key_type)): for wallet_id in wallet_ids: new_donations = await get_donations(wallet_id) 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}") diff --git a/lnbits/extensions/tipjar/views_api.py b/lnbits/extensions/tipjar/views_api.py index c4d72ccdb..5a55a3ca0 100644 --- a/lnbits/extensions/tipjar/views_api.py +++ b/lnbits/extensions/tipjar/views_api.py @@ -92,7 +92,7 @@ async def api_get_tipjars(wallet: WalletTypeInfo = Depends(get_key_type)): for wallet_id in wallet_ids: new_tipjars = await get_tipjars(wallet_id) 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") @@ -103,7 +103,7 @@ async def api_get_tips(wallet: WalletTypeInfo = Depends(get_key_type)): for wallet_id in wallet_ids: new_tips = await get_tips(wallet_id) 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}")