Merge pull request #487 from christianlouis/copilot/fix-mypy-error-templates

Fix mypy TemplateResponse annotation in db_wizard and harden owner fallback in process_document
This commit is contained in:
Christian Krakau-Louis
2026-03-06 12:20:46 +01:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -56,8 +56,9 @@ def process_document(
3. If force_cloud_ocr is True, skip local text extraction and use cloud OCR 3. If force_cloud_ocr is True, skip local text extraction and use cloud OCR
""" """
# Fall back to the configured default_owner_id when no explicit owner was provided # Fall back to the configured default_owner_id when no explicit owner was provided
if owner_id is None and settings.default_owner_id: default_owner_id = settings.default_owner_id
owner_id = settings.default_owner_id if owner_id is None and isinstance(default_owner_id, str) and default_owner_id.strip():
owner_id = default_owner_id
task_id = self.request.id task_id = self.request.id
logger.info(f"[{task_id}] Starting document processing: {original_local_file}") logger.info(f"[{task_id}] Starting document processing: {original_local_file}")
+2 -1
View File
@@ -8,6 +8,7 @@ and migrating data from one database to another.
import logging import logging
from fastapi import Request from fastapi import Request
from fastapi.responses import Response
from app.config import settings from app.config import settings
from app.views.base import APIRouter, templates from app.views.base import APIRouter, templates
@@ -17,7 +18,7 @@ router = APIRouter()
@router.get("/database-wizard") @router.get("/database-wizard")
async def database_wizard(request: Request) -> templates.TemplateResponse: async def database_wizard(request: Request) -> Response:
"""Render the database configuration wizard page.""" """Render the database configuration wizard page."""
return templates.TemplateResponse( return templates.TemplateResponse(
"db_wizard.html", "db_wizard.html",