From bdff373959fa3928aa7cd1f4ffd51ab3710a17f6 Mon Sep 17 00:00:00 2001 From: Wolf Beckmann Date: Fri, 27 Mar 2026 10:06:41 +0100 Subject: [PATCH] fix(diarization-ui): have _job_get return dict instead of sqlite3.Row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sqlite3.Row does not support .get() — converting to dict at the source fixes all current and future call sites uniformly. Co-Authored-By: Claude Sonnet 4.6 --- app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index bf3e196..19b813a 100644 --- a/app.py +++ b/app.py @@ -280,7 +280,8 @@ def get_prompts(): def _job_get(job_id: int): with db() as c: - return c.execute("SELECT * FROM jobs WHERE id=?", (job_id,)).fetchone() + row = c.execute("SELECT * FROM jobs WHERE id=?", (job_id,)).fetchone() + return dict(row) if row else None def _job_set(job_id: int, **fields): @@ -348,7 +349,7 @@ def _process_analysis_job(job_id: int): if not doc or not prm: raise RuntimeError("Dokument oder Prompt nicht gefunden") - user_extra = (j["user_prompt"] or "").strip() if j["user_prompt"] is not None else "" + user_extra = (j.get("user_prompt") or "").strip() llm_prompt = ( "Du bist ein präziser Assistent. Antworte auf Deutsch.\\n" f"AUFTRAG:\\n{prm['prompt']}\\n"