Skip to content

Commit f6d8dff

Browse files
committed
fix: type fixes
1 parent 0ee95c9 commit f6d8dff

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

backend/api/init/init_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class InitResponseModel(ResponseModel):
4848
description="Is the login background image enabled?",
4949
default_factory=is_login_background_enabled,
5050
),
51-
]
51+
] = False
5252

5353
user: Annotated[
5454
UserModel | None,

backend/server/server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from fastapi.websockets import WebSocket, WebSocketDisconnect
1111

1212
import nebula
13-
from nebula.exceptions import NebulaException
13+
from nebula.exceptions import NebulaException, NotFoundException
1414
from nebula.plugins.frontend import get_frontend_plugins
1515
from nebula.settings import load_settings
1616
from server.endpoints import install_endpoints
@@ -174,13 +174,14 @@ async def ws_endpoint(websocket: WebSocket) -> None:
174174
# API endpoints and the frontend
175175
#
176176

177+
177178
@app.get("/api/login-background.jpg")
178179
def login_background() -> FileResponse:
179180
"""Serve the login background image."""
180181
img_path = f"/mnt/{nebula.config.site_name}_01/.nx/login-background.jpg"
181182
if os.path.exists(img_path):
182183
return FileResponse(img_path, media_type="image/jpeg")
183-
return JSONResponse(status_code=404, content={"detail": "File not found"})
184+
raise NotFoundException("Login background image not found")
184185

185186

186187
def install_frontend_plugins(app: FastAPI) -> None:

0 commit comments

Comments
 (0)