black formatting

This commit is contained in:
Kristjan
2020-12-31 18:50:16 +01:00
parent 128888be92
commit c082c953f3
12 changed files with 98 additions and 43 deletions
+6 -8
View File
@@ -6,6 +6,7 @@ from . import db
from .models import Tickets, Forms
import httpx
async def create_ticket(
payment_hash: str,
wallet: str,
@@ -52,19 +53,14 @@ async def set_ticket_paid(payment_hash: str) -> Tickets:
""",
(amount, row[1]),
)
ticket = await get_ticket(payment_hash)
if formdata.webhook:
async with httpx.AsyncClient() as client:
try:
r = await client.post(
formdata.webhook,
json={
"form": ticket.form,
"name": ticket.name,
"email": ticket.email,
"content": ticket.ltext
},
json={"form": ticket.form, "name": ticket.name, "email": ticket.email, "content": ticket.ltext},
timeout=40,
)
except AssertionError:
@@ -96,7 +92,9 @@ async def delete_ticket(ticket_id: str) -> None:
# FORMS
async def create_form(*, wallet: str, name: str, webhook: Optional[str] = None, description: str, costpword: int) -> Forms:
async def create_form(
*, wallet: str, name: str, webhook: Optional[str] = None, description: str, costpword: int
) -> Forms:
form_id = urlsafe_short_hash()
await db.execute(
"""