From c6b4fe1653c75ae555c026e2049ec749540aa264 Mon Sep 17 00:00:00 2001
From: Tim Ballard <1425377+timoballard@users.noreply.github.com>
Date: Tue, 16 Jan 2024 11:09:05 -0600
Subject: [PATCH 1/2] rm date from my submissions date (#3200)
---
backend/audit/templates/audit/my_submissions.html | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/backend/audit/templates/audit/my_submissions.html b/backend/audit/templates/audit/my_submissions.html
index 66542c5c9d..4377332296 100644
--- a/backend/audit/templates/audit/my_submissions.html
+++ b/backend/audit/templates/audit/my_submissions.html
@@ -45,9 +45,7 @@
Audits in progress
{{ item.auditee_name }} |
{{ item.report_id }} |
{{ item.auditee_uei }} |
-
- {{ item.fiscal_year_end_date }}
- |
+ {{ item.fiscal_year_end_date }} |
{% endfor %}
From be95d5a4776bc02190b65a58aa1bbb4f5ab36362 Mon Sep 17 00:00:00 2001
From: "Hassan D. M. Sambo"
Date: Tue, 16 Jan 2024 15:34:10 -0500
Subject: [PATCH 2/2] #3202 Updated code to migrate cognizant and oversight
data (#3204)
* #3202 Updated code to migrate cognizant and oversight data
* #3202 Fixed failing tests
---
.../sac_general_lib/cognizant_oversight.py | 15 +++++++++++++++
.../sac_general_lib/sac_creator.py | 5 +++++
.../test_sac_creation.py | 2 ++
3 files changed, 22 insertions(+)
create mode 100644 backend/census_historical_migration/sac_general_lib/cognizant_oversight.py
diff --git a/backend/census_historical_migration/sac_general_lib/cognizant_oversight.py b/backend/census_historical_migration/sac_general_lib/cognizant_oversight.py
new file mode 100644
index 0000000000..48f3c60d63
--- /dev/null
+++ b/backend/census_historical_migration/sac_general_lib/cognizant_oversight.py
@@ -0,0 +1,15 @@
+from ..exception_utils import DataMigrationError
+from ..transforms.xform_string_to_string import string_to_string
+
+
+def cognizant_oversight(audit_header):
+ """Retrieve cognizant oversight information for a given audit header."""
+
+ cognizant = string_to_string(audit_header.COGAGENCY)
+ oversight = string_to_string(audit_header.OVERSIGHTAGENCY)
+ if cognizant and len(cognizant) > 2:
+ raise DataMigrationError(
+ f"Invalid cognizant agency: {cognizant}", "invalid_cognizant"
+ )
+
+ return cognizant, oversight
diff --git a/backend/census_historical_migration/sac_general_lib/sac_creator.py b/backend/census_historical_migration/sac_general_lib/sac_creator.py
index a2e5e9b51c..438a051e16 100644
--- a/backend/census_historical_migration/sac_general_lib/sac_creator.py
+++ b/backend/census_historical_migration/sac_general_lib/sac_creator.py
@@ -3,6 +3,8 @@
from django.apps import apps
from django.conf import settings
+from .cognizant_oversight import cognizant_oversight
+
from ..exception_utils import DataMigrationError
from .general_information import (
general_information,
@@ -80,6 +82,9 @@ def setup_sac(user, audit_header):
sac.auditee_certification = auditee_certification(audit_header)
sac.auditor_certification = auditor_certification(audit_header)
+ cognizant, oversight = cognizant_oversight(audit_header)
+ sac.cognizant_agency = cognizant
+ sac.oversight_agency = oversight
sac.data_source = settings.CENSUS_DATA_SOURCE
if general_info["user_provided_organization_type"] == "tribal":
diff --git a/backend/census_historical_migration/test_sac_creation.py b/backend/census_historical_migration/test_sac_creation.py
index ea9214b583..423c1c3e90 100644
--- a/backend/census_historical_migration/test_sac_creation.py
+++ b/backend/census_historical_migration/test_sac_creation.py
@@ -56,6 +56,8 @@ def __init__(
self.TYPEREPORT_SP_FRAMEWORK = "UQAD"
self.UEI = "ZQGGHJH74DW7"
self.ZIPCODE = "10451"
+ self.COGAGENCY = "14"
+ self.OVERSIGHTAGENCY = "84"
def _mock_audit_header(self, entity_type, suppression_code=None):
"""Returns a mock audit header with all necessary fields"""