From 575b4e088e77513468ffd1742f684a2623576d02 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 10:47:46 +0000 Subject: [PATCH] fix(views): resolve mypy TemplateResponse typing and owner fallback Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- app/tasks/process_document.py | 5 +++-- app/views/db_wizard.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/tasks/process_document.py b/app/tasks/process_document.py index 0489b315..6eb2da13 100644 --- a/app/tasks/process_document.py +++ b/app/tasks/process_document.py @@ -56,8 +56,9 @@ def process_document( 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 - if owner_id is None and settings.default_owner_id: - owner_id = settings.default_owner_id + default_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 logger.info(f"[{task_id}] Starting document processing: {original_local_file}") diff --git a/app/views/db_wizard.py b/app/views/db_wizard.py index 9c1b715a..15526658 100644 --- a/app/views/db_wizard.py +++ b/app/views/db_wizard.py @@ -8,6 +8,7 @@ and migrating data from one database to another. import logging from fastapi import Request +from fastapi.responses import Response from app.config import settings from app.views.base import APIRouter, templates @@ -17,7 +18,7 @@ router = APIRouter() @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.""" return templates.TemplateResponse( "db_wizard.html",