mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 19:09:22 +02:00
Linting and comments
This commit is contained in:
parent
4594eb7ca3
commit
14355327b2
4 changed files with 18 additions and 7 deletions
|
@ -93,7 +93,7 @@ def available(request, domain=""):
|
|||
|
||||
@require_http_methods(["GET"])
|
||||
@login_not_required
|
||||
def get_current_full(request, file_path = "migrationdata/current-full.csv"):
|
||||
def get_current_full(request, file_path="migrationdata/current-full.csv"):
|
||||
# Open the CSV file
|
||||
file_path = "migrationdata/current-full.csv"
|
||||
return serve_file(file_path)
|
||||
|
@ -101,9 +101,10 @@ def get_current_full(request, file_path = "migrationdata/current-full.csv"):
|
|||
|
||||
@require_http_methods(["GET"])
|
||||
@login_not_required
|
||||
def get_current_federal(request, file_path = "migrationdata/current-federal.csv"):
|
||||
def get_current_federal(request, file_path="migrationdata/current-federal.csv"):
|
||||
return serve_file(file_path)
|
||||
|
||||
|
||||
def serve_file(file_path):
|
||||
"""Downloads a file based on a given filepath. Returns a 404 if not found."""
|
||||
# TODO - #1403, grab from the S3 instance instead
|
||||
|
@ -112,4 +113,4 @@ def serve_file(file_path):
|
|||
response = FileResponse(open(file_path, "rb"))
|
||||
return response
|
||||
else:
|
||||
return HttpResponse("File not found", status=404)
|
||||
return HttpResponse("File not found", status=404)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue