chore: code format

This commit is contained in:
Vlad Stan 2023-02-15 10:49:36 +02:00
parent 366dae2082
commit 58723a387f
6 changed files with 52 additions and 42 deletions

View file

@ -35,13 +35,16 @@ async def on_invoice_paid(payment: Payment):
await invoice_paid_for_storage(relay_id, pubkey, storage_to_buy)
return
async def invoice_paid_to_join(relay_id: str, pubkey: str):
try:
account = await get_account(relay_id, pubkey)
if not account:
await create_account(relay_id, NostrAccount(pubkey=pubkey, paid_to_join=True))
await create_account(
relay_id, NostrAccount(pubkey=pubkey, paid_to_join=True)
)
return
if account.blocked or account.paid_to_join:
return
@ -56,9 +59,11 @@ async def invoice_paid_for_storage(relay_id: str, pubkey: str, storage_to_buy: i
try:
account = await get_account(relay_id, pubkey)
if not account:
await create_account(relay_id, NostrAccount(pubkey=pubkey, storage=storage_to_buy))
await create_account(
relay_id, NostrAccount(pubkey=pubkey, storage=storage_to_buy)
)
return
if account.blocked:
return
@ -66,4 +71,4 @@ async def invoice_paid_for_storage(relay_id: str, pubkey: str, storage_to_buy: i
await update_account(relay_id, account)
except Exception as ex:
logger.warning(ex)
logger.warning(ex)