From 42ea13e413bef7cec19d3d5497e8457938a80560 Mon Sep 17 00:00:00 2001 From: HotSwapp <47397945+HotSwapp@users.noreply.github.com> Date: Mon, 13 Oct 2025 10:23:46 -0500 Subject: [PATCH] Fix import status logic bug The import_log.status was incorrectly set to 'failed' when there were NO errors. The condition 'if result["errors"]' evaluates to False when errors list is empty, causing the logic to be inverted. Fixed: 'completed' if not result['errors'] else 'failed' This caused successful imports with 0 errors to show as 'Failed' in the UI. --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index b7f1914..917158b 100644 --- a/app/main.py +++ b/app/main.py @@ -1961,7 +1961,7 @@ async def admin_import_data( result = process_csv_import(db, data_type, file_path) # Update import log - import_log.status = "completed" if result['errors'] else "failed" + import_log.status = "completed" if not result['errors'] else "failed" import_log.total_rows = result['total_rows'] import_log.success_count = result['success'] import_log.error_count = len(result['errors'])