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:
parent
2fc8a1adce
commit
3d24987365
@ -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,))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user