mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-20 03:19:24 +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
|
||||
|
|
|
@ -15,9 +15,14 @@ class Command(BaseCommand):
|
|||
def add_arguments(self, parser):
|
||||
"""Add our two filename arguments."""
|
||||
parser.add_argument("--directory", default="migrationdata", help="Desired directory")
|
||||
parser.add_argument("--checkpath", default=True, help="Used for test cases")
|
||||
parser.add_argument(
|
||||
"--checkpath",
|
||||
default=True,
|
||||
help="Flag that determines if we do a check for os.path.exists. Used for test cases",
|
||||
)
|
||||
|
||||
def handle(self, **options):
|
||||
"""Grabs the directory then creates current-federal.csv in that directory"""
|
||||
# Ensures a slash is added
|
||||
directory = os.path.join(options.get("directory"), "")
|
||||
check_path = options.get("checkpath")
|
||||
|
|
|
@ -15,9 +15,14 @@ class Command(BaseCommand):
|
|||
def add_arguments(self, parser):
|
||||
"""Add our two filename arguments."""
|
||||
parser.add_argument("--directory", default="migrationdata", help="Desired directory")
|
||||
parser.add_argument("--checkpath", default=True, help="Used for test cases")
|
||||
parser.add_argument(
|
||||
"--checkpath",
|
||||
default=True,
|
||||
help="Flag that determines if we do a check for os.path.exists. Used for test cases",
|
||||
)
|
||||
|
||||
def handle(self, **options):
|
||||
"""Grabs the directory then creates current-full.csv in that directory"""
|
||||
# Ensures a slash is added
|
||||
directory = os.path.join(options.get("directory"), "")
|
||||
check_path = options.get("checkpath")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue