chore: code format

This commit is contained in:
Vlad Stan 2023-03-17 15:06:09 +02:00
parent 30ffcf7f55
commit 3aa4875558
3 changed files with 10 additions and 10 deletions

View file

@ -21,17 +21,16 @@ nostrrelay_static_files = [
] ]
nostrrelay_redirect_paths = [ nostrrelay_redirect_paths = [
{ {
"from_path": "/", "from_path": "/",
"redirect_to_path": "/api/v1/relay-info", "redirect_to_path": "/api/v1/relay-info",
"header_filters": { "header_filters": {"accept": "application/nostr+json"},
"accept": "application/nostr+json"
} }
}
] ]
scheduled_tasks: List[asyncio.Task] = [] scheduled_tasks: List[asyncio.Task] = []
def nostrrelay_renderer(): def nostrrelay_renderer():
return template_renderer(["lnbits/extensions/nostrrelay/templates"]) return template_renderer(["lnbits/extensions/nostrrelay/templates"])

View file

@ -121,7 +121,7 @@ async def api_toggle_relay(
) -> NostrRelay: ) -> NostrRelay:
try: try:
relay = await get_relay(wallet.wallet.user,relay_id) relay = await get_relay(wallet.wallet.user, relay_id)
if not relay: if not relay:
raise HTTPException( raise HTTPException(
status_code=HTTPStatus.NOT_FOUND, status_code=HTTPStatus.NOT_FOUND,
@ -159,12 +159,13 @@ async def api_get_relays(
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, status_code=HTTPStatus.INTERNAL_SERVER_ERROR,
detail="Cannot fetch relays", detail="Cannot fetch relays",
) )
@nostrrelay_ext.get("/api/v1/relay-info") @nostrrelay_ext.get("/api/v1/relay-info")
async def api_get_relay_info() -> JSONResponse: async def api_get_relay_info() -> JSONResponse:
return relay_info_response(NostrRelay.info()) return relay_info_response(NostrRelay.info())
@nostrrelay_ext.get("/api/v1/relay/{relay_id}") @nostrrelay_ext.get("/api/v1/relay/{relay_id}")
async def api_get_relay( async def api_get_relay(
relay_id: str, wallet: WalletTypeInfo = Depends(require_invoice_key) relay_id: str, wallet: WalletTypeInfo = Depends(require_invoice_key)