Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filename to FileResponse #164

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

jcadam14
Copy link
Contributor

Closes #163

@jcadam14 jcadam14 self-assigned this Apr 16, 2024
@jcadam14 jcadam14 linked an issue Apr 16, 2024 that may be closed by this pull request
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/sbl_filing_api/routers
  filing.py
Project Total  

This report was generated by python-coverage-comment-action

Copy link

@natalia-fitzgerald natalia-fitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @jcadam14!

@@ -235,7 +235,7 @@ async def get_latest_submission_report(request: Request, lei: str, period_code:
file_data = await submission_processor.get_from_storage(
period_code, lei, str(latest_sub.id) + submission_processor.REPORT_QUALIFIER
)
return FileResponse(path=file_data, media_type="text/csv")
return FileResponse(path=file_data, media_type="text/csv", filename=f"{latest_sub.id}validation_report.csv")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be easier to read if we put a _ between the id and the suffix? e.g. 1_validation_report.csv

Copy link
Collaborator

@lchen-2101 lchen-2101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lchen-2101 lchen-2101 merged commit 1a9f7d5 into main Apr 16, 2024
3 checks passed
@lchen-2101 lchen-2101 deleted the 163-set-file-name-on-report-fileresponse branch April 16, 2024 18:13
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.

Set file name on /report FileResponse
3 participants