Fix ticket create (#13)
* don't set ticket as paid on create * use crud fn in tasks.py * create ticket is unpaid by default
This commit is contained in:
parent
c8b31d8e3f
commit
00f552c751
4 changed files with 41 additions and 24 deletions
9
tasks.py
9
tasks.py
|
|
@ -4,8 +4,7 @@ from lnbits.core.models import Payment
|
|||
from lnbits.helpers import get_current_extension_name
|
||||
from lnbits.tasks import register_invoice_listener
|
||||
|
||||
from .models import CreateTicket
|
||||
from .views_api import api_ticket_send_ticket
|
||||
from .crud import set_ticket_paid
|
||||
|
||||
|
||||
async def wait_for_paid_invoices():
|
||||
|
|
@ -25,8 +24,6 @@ async def on_invoice_paid(payment: Payment) -> None:
|
|||
and payment.extra.get("name")
|
||||
and payment.extra.get("email")
|
||||
):
|
||||
await api_ticket_send_ticket(
|
||||
payment.memo,
|
||||
payment.payment_hash,
|
||||
)
|
||||
|
||||
await set_ticket_paid(payment.payment_hash)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue