Skip to content

Commit

Permalink
Merge pull request #3208 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Jan 17, 2024
2 parents fa11c9d + be95d5a commit 5337d77
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
4 changes: 1 addition & 3 deletions backend/audit/templates/audit/my_submissions.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ <h1 class="font-sans-xl">Audits in progress</h1>
<td>{{ item.auditee_name }}</td>
<td>{{ item.report_id }}</td>
<td>{{ item.auditee_uei }}</td>
<td>
<a class="usa-link" href="/report_submission/general-information/{{ item.report_id }}">{{ item.fiscal_year_end_date }}</a>
</td>
<td>{{ item.fiscal_year_end_date }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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":
Expand Down
2 changes: 2 additions & 0 deletions backend/census_historical_migration/test_sac_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down

0 comments on commit 5337d77

Please sign in to comment.