Adds public events endpoint and user tickets
Some checks are pending
lint / lint (push) Waiting to run

Adds a public events endpoint that allows read-only access to all events.
Improves ticket management by adding support for user IDs as an identifier, alongside name and email.
This simplifies ticket creation for authenticated users and enhances security.
Also introduces an API endpoint to fetch tickets by user ID.
This commit is contained in:
padreug 2025-11-03 23:05:31 +01:00
parent c729ef17a6
commit c669da5822
7 changed files with 377 additions and 20 deletions

View file

@ -21,8 +21,12 @@ async def on_invoice_paid(payment: Payment) -> None:
if not payment.extra or "events" != payment.extra.get("tag"):
return
if not payment.extra.get("name") or not payment.extra.get("email"):
logger.warning(f"Ticket {payment.payment_hash} missing name or email.")
# Check if ticket has either name/email or user_id
has_name_email = payment.extra.get("name") and payment.extra.get("email")
has_user_id = payment.extra.get("user_id")
if not has_name_email and not has_user_id:
logger.warning(f"Ticket {payment.payment_hash} missing name/email or user_id.")
return
ticket = await get_ticket(payment.payment_hash)