Corrected Response import in main.py

This commit is contained in:
2025-11-17 14:26:44 +01:00
parent 1535d90842
commit 8bc24fc80a

View File

@@ -1,6 +1,6 @@
import os
from fastapi import FastAPI, Request, Depends, HTTPException
from starlette.middleware.sessions import SessionMiddleware
from starlette.middleware.sessions import SessionMiddleware
from starlette.staticfiles import StaticFiles
from starlette.responses import FileResponse, RedirectResponse
from fastapi.templating import Jinja2Templates
@@ -11,6 +11,7 @@ import models
from database import engine
import auth # Import the new auth module
import schemas
from starlette.responses import Response
from config import settings # Import settings to get the secret key
# --- Absolute Path Configuration ---
@@ -100,7 +101,7 @@ async def read_overlay(request: Request, user_id: int, theme_override: str = Non
# Use a generic overlay template that will link to the dynamic CSS
return templates.TemplateResponse("overlay-custom.html", {"request": request, "theme_id": theme.id})
return templates.TemplateResponse(f"overlay-{theme}.html", {"request": request})
return templates.TemplateResponse(f"overlay-{theme_name}.html", {"request": request})
@app.post("/api/settings")
async def update_settings(settings_data: schemas.SettingsUpdate, request: Request, db: Session = Depends(auth.get_db)):