diff --git a/backend/audit/models.py b/backend/audit/models.py index 88019b1bac..849a4c8cc6 100644 --- a/backend/audit/models.py +++ b/backend/audit/models.py @@ -569,15 +569,6 @@ def get_transition_date(self, status): return self.transition_date[index] return None - def _general_info_get(self, key): - try: - return self.general_information[key] - except KeyError: - pass - except TypeError: - pass - return None - class AccessManager(models.Manager): """Custom manager for Access.""" diff --git a/backend/audit/viewlib/upload_report_view.py b/backend/audit/viewlib/upload_report_view.py index 020cdcc738..52540deaa1 100644 --- a/backend/audit/viewlib/upload_report_view.py +++ b/backend/audit/viewlib/upload_report_view.py @@ -91,7 +91,9 @@ def get(self, request, *args, **kwargs): report_id = kwargs["report_id"] try: sac = SingleAuditChecklist.objects.get(report_id=report_id) - sar = SingleAuditReportFile.objects.filter(sac_id=sac.id).first() + sar = SingleAuditReportFile.objects.filter(sac_id=sac.id) + if sar.exists(): + sar = sar.latest("date_created") current_info = { "cleaned_data": getattr(sar, "component_page_numbers", {}), diff --git a/backend/cypress/e2e/check-ueid.cy.js b/backend/cypress/e2e/check-ueid.cy.js index 7af4422b29..9102218634 100644 --- a/backend/cypress/e2e/check-ueid.cy.js +++ b/backend/cypress/e2e/check-ueid.cy.js @@ -92,13 +92,13 @@ describe('Create New Audit', () => { ); }); - it('should show an error if the user enters a date before 1/1/2020', () => { - cy.get('#auditee_fiscal_period_start').type('12/31/2019'); + it('should show an error if the user enters a date before 1/1/2016', () => { + cy.get('#auditee_fiscal_period_start').type('12/31/2015'); cy.get('#fy-error-message li').should('have.length', 1); }); - it('should not show an error if the user enters a date after 12/31/2019', () => { - cy.get('#auditee_fiscal_period_start').clear().type('12/31/2020'); + it('should not show an error if the user enters a date after 12/31/2015', () => { + cy.get('#auditee_fiscal_period_start').clear().type('1/1/2016'); cy.get('#fy-error-message li').should('have.length', 0); }); }); @@ -131,7 +131,9 @@ describe('Create New Audit', () => { it('should remove the error message when valid end date is supplied', () => { cy.get('#auditee_fiscal_period_end').type('01/31/2023').blur(); - cy.get('#auditee_fiscal_period_end-date-order').should('not.be.visible'); + cy.get('#auditee_fiscal_period_end-date-order').should( + 'not.be.visible' + ); }); }); diff --git a/backend/static/js/check-ueid.js b/backend/static/js/check-ueid.js index 3eb08d0dad..5030c55a00 100644 --- a/backend/static/js/check-ueid.js +++ b/backend/static/js/check-ueid.js @@ -193,10 +193,10 @@ function validateFyStartDate(fyInput) { [userFy.year, userFy.month, userFy.day] = fyInput.value.split('-'); fyErrorContainer.innerHTML = ''; - if (userFy.year < 2020) { + if (userFy.year < 2016) { const errorEl = document.createElement('li'); errorEl.innerHTML = - 'We are currently only accepting audits from FY22.\ + 'We are currently only accepting audits from FY16 or later.\ To submit an audit for a different fiscal period, \ visit the Census Bureau.'; fyErrorContainer.appendChild(errorEl); diff --git a/backend/support/migrations/0005_alter_cognizantbaseline_cognizant_agency_and_more.py b/backend/support/migrations/0005_alter_cognizantbaseline_cognizant_agency_and_more.py new file mode 100644 index 0000000000..4d02d3f6f1 --- /dev/null +++ b/backend/support/migrations/0005_alter_cognizantbaseline_cognizant_agency_and_more.py @@ -0,0 +1,81 @@ +# Generated by Django 4.2.5 on 2023-10-13 19:54 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + dependencies = [ + ("support", "0004_alter_cognizantbaseline_date_assigned_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="cognizantbaseline", + name="cognizant_agency", + field=models.CharField( + help_text="Two digit Federal agency prefix of the cognizant agency", + max_length=2, + verbose_name="Cog Agency", + ), + ), + migrations.AlterField( + model_name="cognizantbaseline", + name="date_assigned", + field=models.DateTimeField( + default=django.utils.timezone.now, + help_text="Time when the cog agency was assigned to the entity", + null=True, + verbose_name="Date Assigned", + ), + ), + migrations.AlterField( + model_name="cognizantbaseline", + name="dbkey", + field=models.CharField( + help_text="Identifier for a submission along with audit_year in Census FAC", + max_length=20, + null=True, + verbose_name="dbkey", + ), + ), + migrations.AlterField( + model_name="cognizantbaseline", + name="ein", + field=models.CharField( + help_text="Primary Employer Identification Number", + max_length=30, + null=True, + verbose_name="EIN", + ), + ), + migrations.AlterField( + model_name="cognizantbaseline", + name="is_active", + field=models.BooleanField( + default=True, + help_text="Record to be ignored if this field is False", + verbose_name="Active", + ), + ), + migrations.AlterField( + model_name="cognizantbaseline", + name="source", + field=models.CharField( + default="GSAFAC", + help_text="Source of cognizant data", + max_length=10, + verbose_name="Source", + ), + ), + migrations.AlterField( + model_name="cognizantbaseline", + name="uei", + field=models.CharField( + help_text="Unique Employer Identification Number", + max_length=30, + null=True, + verbose_name="UEI", + ), + ), + ]