Skip to content

Commit 729bb8d

Browse files
authored
[PRMP-846] Bug daily_statistical_report_bulk_upload_rejected (#894)
1 parent d719a41 commit 729bb8d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lambdas/services/bulk_upload_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ def handle_sqs_message(self, message: dict):
131131
file_metadata.scan_date = validate_scan_date(file_metadata.scan_date)
132132
request_context.patient_nhs_no = staging_metadata.nhs_number
133133
validate_nhs_number(staging_metadata.nhs_number)
134-
validate_lg_file_names(file_names, staging_metadata.nhs_number)
135134
pds_patient_details = getting_patient_info_from_pds(
136135
staging_metadata.nhs_number
137136
)
138137
patient_ods_code = (
139138
pds_patient_details.get_ods_code_or_inactive_status_for_gp()
140139
)
140+
validate_lg_file_names(file_names, staging_metadata.nhs_number)
141141

142142
if not self.bypass_pds:
143143
if not self.strict_mode:

lambdas/tests/unit/services/test_bulk_upload_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def test_handle_sqs_message_calls_report_upload_failure_when_patient_record_alre
378378
mock_create_lg_records_and_copy_files.assert_not_called()
379379
mock_remove_ingested_file_from_source_bucket.assert_not_called()
380380
mock_report_upload_failure.assert_called_with(
381-
TEST_STAGING_METADATA, UploadStatus.FAILED, str(mocked_error), ""
381+
TEST_STAGING_METADATA, UploadStatus.FAILED, str(mocked_error), "Y12345"
382382
)
383383
repo_under_test.sqs_repository.send_message_to_pdf_stitching_queue.assert_not_called()
384384

@@ -416,7 +416,7 @@ def test_handle_sqs_message_calls_report_upload_failure_when_lg_file_name_invali
416416
TEST_STAGING_METADATA_WITH_INVALID_FILENAME,
417417
UploadStatus.FAILED,
418418
str(mocked_error),
419-
"",
419+
"Y12345"
420420
)
421421
repo_under_test.sqs_repository.send_message_to_pdf_stitching_queue.assert_not_called()
422422

0 commit comments

Comments
 (0)