From 0ea5d9a77b50922308712946400fe8fd4171e129 Mon Sep 17 00:00:00 2001 From: James Person Date: Thu, 12 Mar 2026 12:08:13 -0400 Subject: [PATCH 1/9] Resubmission - Allow users to copy their old report files and form content. --- backend/audit/forms.py | 29 ++++ .../audit/templates/audit/upload-report.html | 16 ++ backend/audit/views/upload_report_view.py | 140 ++++++++++++++---- backend/dissemination/file_downloads.py | 32 +++- backend/static/js/upload-report.js | 28 ++++ 5 files changed, 215 insertions(+), 30 deletions(-) diff --git a/backend/audit/forms.py b/backend/audit/forms.py index bfdd6073f4..5967f5feac 100644 --- a/backend/audit/forms.py +++ b/backend/audit/forms.py @@ -22,6 +22,35 @@ class UploadReportForm(forms.Form): schedule_prior_findings = forms.IntegerField(initial=0, required=False, min_value=1) CAP_page = forms.IntegerField(initial=0, required=False, min_value=1) upload_report = forms.FileField() + keep_previous_report = forms.BooleanField(required=False) + + def clean(self): + """ + For 'Original' submissions, these fields do not really need cleaning - they're integers, so the default errors will do. + The view will handle erroneous report uploads. + + For resubmissions, a user might upload an erroneous report and then indicate to keep their previous report. + Then, we want to clear all errors. + """ + cleaned_data = super().clean() + if cleaned_data.get("keep_previous_report"): + for field in [ + "financial_statements", + "financial_statements_opinion", + "schedule_expenditures", + "schedule_expenditures_opinion", + "uniform_guidance_control", + "uniform_guidance_compliance", + "GAS_control", + "GAS_compliance", + "schedule_findings", + "schedule_prior_findings", + "CAP_page", + "upload_report", + ]: + if field in self.errors: + del self.errors[field] + return cleaned_data def _kvpair(info): diff --git a/backend/audit/templates/audit/upload-report.html b/backend/audit/templates/audit/upload-report.html index 6d7e11d50e..843ed3540b 100644 --- a/backend/audit/templates/audit/upload-report.html +++ b/backend/audit/templates/audit/upload-report.html @@ -96,6 +96,22 @@ {% if already_submitted %}Re-upload{% else