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.
This commit is contained in:
Christian 2026-03-02 00:05:24 +01:00
parent 2fc8a1adce
commit 3d24987365
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
2.2.16 2.2.17

View File

@ -2023,7 +2023,7 @@ async def upload_supplier_invoice(file: UploadFile = File(...)):
checksum = ollama_service.calculate_file_checksum(temp_path) checksum = ollama_service.calculate_file_checksum(temp_path)
# Check for duplicate file # Check for duplicate file
existing_file = execute_query( existing_file = execute_query_single(
"SELECT file_id, status FROM incoming_files WHERE checksum = %s", "SELECT file_id, status FROM incoming_files WHERE checksum = %s",
(checksum,)) (checksum,))