I want them to turn black
This commit is contained in:
+16
-32
@@ -58,10 +58,11 @@ async def get_user(user_id: str, conn: Optional[Connection] = None) -> Optional[
|
||||
return None
|
||||
|
||||
return User(
|
||||
id = user['id'],
|
||||
email = user['email'],
|
||||
extensions = [e[0] for e in extensions],
|
||||
wallets = [Wallet(**w) for w in wallets])
|
||||
id=user["id"],
|
||||
email=user["email"],
|
||||
extensions=[e[0] for e in extensions],
|
||||
wallets=[Wallet(**w) for w in wallets],
|
||||
)
|
||||
|
||||
|
||||
async def update_user_extension(
|
||||
@@ -106,6 +107,7 @@ async def create_wallet(
|
||||
|
||||
return new_wallet
|
||||
|
||||
|
||||
async def update_wallet(
|
||||
wallet_id: str, new_name: str, conn: Optional[Connection] = None
|
||||
) -> Optional[Wallet]:
|
||||
@@ -115,7 +117,7 @@ async def update_wallet(
|
||||
name = ?
|
||||
WHERE id = ?
|
||||
""",
|
||||
(new_name, wallet_id)
|
||||
(new_name, wallet_id),
|
||||
)
|
||||
|
||||
|
||||
@@ -276,9 +278,7 @@ async def get_payments(
|
||||
return [Payment.from_row(row) for row in rows]
|
||||
|
||||
|
||||
async def delete_expired_invoices(
|
||||
conn: Optional[Connection] = None,
|
||||
) -> None:
|
||||
async def delete_expired_invoices(conn: Optional[Connection] = None,) -> None:
|
||||
# first we delete all invoices older than one month
|
||||
await (conn or db).execute(
|
||||
f"""
|
||||
@@ -367,31 +367,22 @@ async def create_payment(
|
||||
|
||||
|
||||
async def update_payment_status(
|
||||
checking_id: str,
|
||||
pending: bool,
|
||||
conn: Optional[Connection] = None,
|
||||
checking_id: str, pending: bool, conn: Optional[Connection] = None
|
||||
) -> None:
|
||||
await (conn or db).execute(
|
||||
"UPDATE apipayments SET pending = ? WHERE checking_id = ?",
|
||||
(
|
||||
pending,
|
||||
checking_id,
|
||||
),
|
||||
(pending, checking_id),
|
||||
)
|
||||
|
||||
|
||||
async def delete_payment(
|
||||
checking_id: str,
|
||||
conn: Optional[Connection] = None,
|
||||
) -> None:
|
||||
async def delete_payment(checking_id: str, conn: Optional[Connection] = None) -> None:
|
||||
await (conn or db).execute(
|
||||
"DELETE FROM apipayments WHERE checking_id = ?", (checking_id,)
|
||||
)
|
||||
|
||||
|
||||
async def check_internal(
|
||||
payment_hash: str,
|
||||
conn: Optional[Connection] = None,
|
||||
payment_hash: str, conn: Optional[Connection] = None
|
||||
) -> Optional[str]:
|
||||
row = await (conn or db).fetchone(
|
||||
"""
|
||||
@@ -411,9 +402,7 @@ async def check_internal(
|
||||
|
||||
|
||||
async def save_balance_check(
|
||||
wallet_id: str,
|
||||
url: str,
|
||||
conn: Optional[Connection] = None,
|
||||
wallet_id: str, url: str, conn: Optional[Connection] = None
|
||||
):
|
||||
domain = urlparse(url).netloc
|
||||
|
||||
@@ -427,9 +416,7 @@ async def save_balance_check(
|
||||
|
||||
|
||||
async def get_balance_check(
|
||||
wallet_id: str,
|
||||
domain: str,
|
||||
conn: Optional[Connection] = None,
|
||||
wallet_id: str, domain: str, conn: Optional[Connection] = None
|
||||
) -> Optional[BalanceCheck]:
|
||||
row = await (conn or db).fetchone(
|
||||
"""
|
||||
@@ -452,9 +439,7 @@ async def get_balance_checks(conn: Optional[Connection] = None) -> List[BalanceC
|
||||
|
||||
|
||||
async def save_balance_notify(
|
||||
wallet_id: str,
|
||||
url: str,
|
||||
conn: Optional[Connection] = None,
|
||||
wallet_id: str, url: str, conn: Optional[Connection] = None
|
||||
):
|
||||
await (conn or db).execute(
|
||||
"""
|
||||
@@ -466,8 +451,7 @@ async def save_balance_notify(
|
||||
|
||||
|
||||
async def get_balance_notify(
|
||||
wallet_id: str,
|
||||
conn: Optional[Connection] = None,
|
||||
wallet_id: str, conn: Optional[Connection] = None
|
||||
) -> Optional[str]:
|
||||
row = await (conn or db).fetchone(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user