python code styling (#739)

This commit is contained in:
Tiago Vasconcelos
2022-07-15 18:11:11 +01:00
committed by GitHub
parent 37c7553c19
commit 348033da1b
10 changed files with 12 additions and 11 deletions

View File

@ -25,7 +25,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
webhook = None webhook = None
data = None data = None
if "copilot" != payment.extra.get("tag"): if payment.extra.get("tag") != "copilot":
# not an copilot invoice # not an copilot invoice
return return

View File

@ -16,7 +16,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "jukebox" != payment.extra.get("tag"): if payment.extra.get("tag") != "jukebox":
# not a jukebox invoice # not a jukebox invoice
return return
await update_jukebox_payment(payment.payment_hash, paid=True) await update_jukebox_payment(payment.payment_hash, paid=True)

View File

@ -22,7 +22,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "livestream" != payment.extra.get("tag"): if payment.extra.get("tag") != "livestream":
# not a livestream invoice # not a livestream invoice
return return

View File

@ -43,13 +43,13 @@ async def call_webhook_on_paid(payment_hash):
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "lnaddress" == payment.extra.get("tag"): if payment.extra.get("tag") == "lnaddress":
await payment.set_pending(False) await payment.set_pending(False)
await set_address_paid(payment_hash=payment.payment_hash) await set_address_paid(payment_hash=payment.payment_hash)
await call_webhook_on_paid(payment_hash=payment.payment_hash) await call_webhook_on_paid(payment_hash=payment.payment_hash)
elif "renew lnaddress" == payment.extra.get("tag"): elif payment.extra.get("tag") == "renew lnaddress":
await payment.set_pending(False) await payment.set_pending(False)
await set_address_renewed( await set_address_renewed(

View File

@ -18,7 +18,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "lnticket" != payment.extra.get("tag"): if payment.extra.get("tag") != "lnticket":
# not a lnticket invoice # not a lnticket invoice
return return

View File

@ -1,5 +1,6 @@
import asyncio import asyncio
import json import json
import httpx import httpx
from lnbits.core import db as core_db from lnbits.core import db as core_db
@ -19,7 +20,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "lnurlp" != payment.extra.get("tag"): if payment.extra.get("tag") != "lnurlp":
# not an lnurlp invoice # not an lnurlp invoice
return return

View File

@ -19,7 +19,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "charge" != payment.extra.get("tag"): if payment.extra.get("tag") != "charge":
# not a charge invoice # not a charge invoice
return return

View File

@ -22,7 +22,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "splitpayments" == payment.extra.get("tag") or payment.extra.get("splitted"): if payment.extra.get("tag") == "splitpayments" or payment.extra.get("splitted"):
# already splitted, ignore # already splitted, ignore
return return

View File

@ -19,7 +19,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "lnsubdomain" != payment.extra.get("tag"): if payment.extra.get("tag") != "lnsubdomain":
# not an lnurlp invoice # not an lnurlp invoice
return return

View File

@ -20,7 +20,7 @@ async def wait_for_paid_invoices():
async def on_invoice_paid(payment: Payment) -> None: async def on_invoice_paid(payment: Payment) -> None:
if "tpos" == payment.extra.get("tag") and payment.extra.get("tipSplitted"): if payment.extra.get("tag") == "tpos" and payment.extra.get("tipSplitted"):
# already splitted, ignore # already splitted, ignore
return return