File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff line change 1010from fastapi .websockets import WebSocket , WebSocketDisconnect
1111
1212import nebula
13- from nebula .exceptions import NebulaException
13+ from nebula .exceptions import NebulaException , NotFoundException
1414from nebula .plugins .frontend import get_frontend_plugins
1515from nebula .settings import load_settings
1616from 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" )
178179def 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
186187def install_frontend_plugins (app : FastAPI ) -> None :
You can’t perform that action at this time.
0 commit comments