chore: update black, new formatting + pre-commit (#3885)

This commit is contained in:
dni ⚡
2026-03-23 10:04:00 +01:00
committed by GitHub
parent 7a393b11fd
commit efc0547271
9 changed files with 119 additions and 178 deletions
+4 -8
View File
@@ -149,14 +149,12 @@ async def get_payments_paginated( # noqa: C901
f"(status = '{PaymentState.SUCCESS}' OR status = '{PaymentState.PENDING}')"
)
elif complete:
clause.append(
f"""
clause.append(f"""
(
status = '{PaymentState.SUCCESS}'
OR (amount < 0 AND status = '{PaymentState.PENDING}')
)
"""
)
""")
elif pending:
clause.append(f"status = '{PaymentState.PENDING}'")
elif failed:
@@ -346,14 +344,12 @@ async def get_payments_history(
"wallet_id": wallet_id,
}
# count outgoing payments if they are still pending
where = [
f"""
where = [f"""
wallet_id = :wallet_id AND (
status = '{PaymentState.SUCCESS}'
OR (amount < 0 AND status = '{PaymentState.PENDING}')
)
"""
]
"""]
clause = filters.where(where)
transactions: list[dict] = await db.fetchall(
# This query is safe from SQL injection: