From 99eba74ff04dafa76838c2fa12ff6a9897ad7615 Mon Sep 17 00:00:00 2001 From: JOHNMWASHUMA Date: Tue, 13 Aug 2024 15:21:11 +0300 Subject: [PATCH] Check that result form does not have duplicate barcodes --- .../apps/tally/management/commands/import_result_forms.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tally_ho/apps/tally/management/commands/import_result_forms.py b/tally_ho/apps/tally/management/commands/import_result_forms.py index 5de11263e..5f821ca2b 100644 --- a/tally_ho/apps/tally/management/commands/import_result_forms.py +++ b/tally_ho/apps/tally/management/commands/import_result_forms.py @@ -4,6 +4,7 @@ from django.conf import settings from tally_ho.apps.tally.management.commands.utils import ( build_generic_model_key_values_from_duckdb_row_tuple_data, + check_duplicates, check_for_missing_columns, get_ballot_by_ballot_number, get_office_by_office_name_and_region_name, @@ -195,6 +196,10 @@ def async_import_results_forms_from_result_forms_file( duckdb_result_forms_data.columns, 'result_form' ) + check_duplicates( + csv_file_path=file_path, + field='barcode' + ) stations_by_number_underscore_center_code =\ {