mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-10 20:42:32 +02:00
Added if webhook to stop 500 in webhook absence
This commit is contained in:
@@ -54,21 +54,22 @@ async def set_ticket_paid(payment_hash: str) -> Tickets:
|
|||||||
)
|
)
|
||||||
|
|
||||||
ticket = await get_ticket(payment_hash)
|
ticket = await get_ticket(payment_hash)
|
||||||
async with httpx.AsyncClient() as client:
|
if formdata.webhook:
|
||||||
try:
|
async with httpx.AsyncClient() as client:
|
||||||
r = await client.post(
|
try:
|
||||||
formdata.webhook,
|
r = await client.post(
|
||||||
json={
|
formdata.webhook,
|
||||||
"form": ticket.form,
|
json={
|
||||||
"name": ticket.name,
|
"form": ticket.form,
|
||||||
"email": ticket.email,
|
"name": ticket.name,
|
||||||
"content": ticket.ltext
|
"email": ticket.email,
|
||||||
},
|
"content": ticket.ltext
|
||||||
timeout=40,
|
},
|
||||||
)
|
timeout=40,
|
||||||
except AssertionError:
|
)
|
||||||
webhook = None
|
except AssertionError:
|
||||||
return ticket
|
webhook = None
|
||||||
|
return ticket
|
||||||
ticket = await get_ticket(payment_hash)
|
ticket = await get_ticket(payment_hash)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user