feat: adhere to ruff's B rules (#2423)

* feat: adhere to ruff's `B` rules
last of the ruff checks.
closes #2308
* B904
* B008
* B005
* B025
* cleanup on fake
This commit is contained in:
dni ⚡
2024-04-17 13:11:51 +02:00
committed by GitHub
parent e13a37c193
commit 98ec59df96
28 changed files with 226 additions and 169 deletions
+4 -4
View File
@@ -43,11 +43,11 @@ async def api_auditor():
"node_balance_msats": int(node_balance),
"lnbits_balance_msats": int(total_balance),
}
except Exception:
except Exception as exc:
raise HTTPException(
status_code=HTTPStatus.INTERNAL_SERVER_ERROR,
detail="Could not audit balance.",
)
) from exc
@admin_router.get(
@@ -113,10 +113,10 @@ async def api_restart_server() -> dict[str, str]:
async def api_topup_balance(data: CreateTopup) -> dict[str, str]:
try:
await get_wallet(data.id)
except Exception:
except Exception as exc:
raise HTTPException(
status_code=HTTPStatus.FORBIDDEN, detail="wallet does not exist."
)
) from exc
if settings.lnbits_backend_wallet_class == "VoidWallet":
raise HTTPException(