Skip to content

[RESUB] - Allow Copying the Previous Report PDF#5446

Open
jperson1 wants to merge 9 commits intomainfrom
jp/pdf-blurbbin
Open

[RESUB] - Allow Copying the Previous Report PDF#5446
jperson1 wants to merge 9 commits intomainfrom
jp/pdf-blurbbin

Conversation

@jperson1
Copy link
Contributor

@jperson1 jperson1 commented Mar 12, 2026

Allow Copying the Previous Report PDF

Allows users to copy the report from the last submission in a resubmission chain. A chain of 2, most likely.

SOT compatible.

Related tickets

Description of changes

Functionality:

  • In the view, a separate path for copying the old data over. Relies on the single field being checked by a user. One supporting function, and probably too much complexity for the post.
  • In the form, one new field. A minimal clean() override to remove any other errors if the user wants to copy.
  • In the HTML, the new checkbox. A new spot for catch-all errors, which may come from the PDF copying.
  • In the JS, an eventListener that disables all the inputs when the user wants to copy.
  • In the supporting file_downloads.py, a new function to do the s3 file copy.
  • Tests to cover the two main cases:
    • An original submission, or one where the user needs to upload a new PDF.
    • A resubmission where we need to copy the report data.

Bonus changes:

  • I moved the tests for this view out of test_views.py into /test_viewlib/test_upload_report_view.py. This is following precedent that I myself set and promptly forgot about.
  • Some little fixes for the existing test_resubmission_start_view.py
  • I replaced a deprecated utcnow() while I was poking around in the tests. There are a few more elsewhere, but I don't need to overstep in a PR that's gotten a little big.

How to test

  1. Switch to this branch and run everything normally.
  2. You will need a submission with an uploaded report. I did the following:
    i. Start and finish a resubmission. Provide a brand new PDF when the time comes.
    ii. Start a resubmission for your just-submitted record.
  3. When reaching the "Audit report PDF" sections, try the new checkbox. Verify in Minio that there are two PDFs, and that they are identical.
  4. Bonus points! Resubmit the form without the checkbox. Provide a new PDF, and see that it replaces the appropriate file in Minio.

Screenshots and recordings

With the new checkbox selected:
image

@jperson1 jperson1 self-assigned this Mar 12, 2026
@jperson1 jperson1 changed the title [RESUB] - Allow Copying Previous Report PDF [RESUB] - Allow Copying the Previous Report PDF Mar 12, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Terraform plan for meta

No changes. Your infrastructure matches the configuration.
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

📝 Plan generated in Pull Request Checks #562

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Terraform plan for dev

Plan: 1 to add, 0 to change, 1 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # module.dev.module.cors.null_resource.cors_header must be replaced
-/+ resource "null_resource" "cors_header" {
!~      id       = "******************" -> (known after apply)
!~      triggers = { # forces replacement
!~          "always_run" = "2026-03-12T12:43:12Z" -> (known after apply)
        }
    }

Plan: 1 to add, 0 to change, 1 to destroy.

📝 Plan generated in Pull Request Checks #562

@jperson1 jperson1 marked this pull request as ready for review March 12, 2026 21:28
@jperson1 jperson1 requested a review from a team March 12, 2026 21:29
@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Branch Rate Health
. 100% 100%
api 98% 86%
api.serializers 97% 88%
api.views 91% 96%
audit 95% 81%
audit.cross_validation 97% 86%
audit.fixtures 84% 50%
audit.formlib 92% 62%
audit.intakelib 89% 83%
audit.intakelib.checks 92% 85%
audit.intakelib.common 98% 82%
audit.intakelib.transforms 100% 95%
audit.management.commands 78% 17%
audit.migrations 100% 100%
audit.models 91% 68%
audit.templatetags 100% 100%
audit.test_viewlib 100% 100%
audit.views 75% 52%
census_historical_migration 96% 65%
census_historical_migration.migrations 100% 100%
census_historical_migration.sac_general_lib 92% 84%
census_historical_migration.transforms 95% 90%
census_historical_migration.workbooklib 68% 69%
config 78% 37%
curation 98% 100%
curation.curationlib 88% 72%
curation.migrations 100% 100%
dissemination 90% 69%
dissemination.analytics 27% 0%
dissemination.forms 80% 30%
dissemination.migrations 97% 25%
dissemination.models 100% 100%
dissemination.report_generation 21% 0%
dissemination.report_generation.excel 32% 0%
dissemination.searchlib 62% 45%
dissemination.templatetags 52% 6%
dissemination.views 67% 48%
djangooidc 53% 38%
djangooidc.tests 100% 94%
report_submission 100% 96%
report_submission.migrations 100% 100%
report_submission.templatetags 74% 100%
report_submission.views 78% 61%
support 94% 75%
support.migrations 100% 100%
support.models 90% 50%
tools 98% 50%
users 95% 86%
users.fixtures 100% 83%
users.management 100% 100%
users.management.commands 100% 100%
users.migrations 100% 100%
Summary 89% (22083 / 24904) 69% (2712 / 3932)

Minimum allowed line rate is 85%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant