From 3d24987365347b780fafef7119bf644617a3c9fd Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 2 Mar 2026 00:05:24 +0100 Subject: [PATCH] fix: use execute_query_single for duplicate checksum check v2.2.17 Fixes 'list indices must be integers or slices, not str' error when uploading a duplicate file. execute_query returns a list, so accessing existing_file['file_id'] caused TypeError. Now uses execute_query_single which returns a single dict row. --- VERSION | 2 +- app/billing/backend/supplier_invoices.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index ed1fc35..c36c648 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.16 +2.2.17 diff --git a/app/billing/backend/supplier_invoices.py b/app/billing/backend/supplier_invoices.py index ce3067d..b717121 100644 --- a/app/billing/backend/supplier_invoices.py +++ b/app/billing/backend/supplier_invoices.py @@ -2023,7 +2023,7 @@ async def upload_supplier_invoice(file: UploadFile = File(...)): checksum = ollama_service.calculate_file_checksum(temp_path) # Check for duplicate file - existing_file = execute_query( + existing_file = execute_query_single( "SELECT file_id, status FROM incoming_files WHERE checksum = %s", (checksum,))