mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 20:18:38 +02:00
Script cleanup / prepare for PR
This commit is contained in:
parent
a188137988
commit
f40e71ca8b
4 changed files with 11 additions and 49 deletions
|
@ -107,6 +107,7 @@ def get_current_federal(request):
|
|||
|
||||
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
|
||||
if os.path.exists(file_path):
|
||||
# Serve the CSV file
|
||||
response = FileResponse(open(file_path, "rb"))
|
||||
|
|
|
@ -21,15 +21,12 @@ class Command(BaseCommand):
|
|||
directory = os.path.join(options.get("directory"), "")
|
||||
logger.info("Generating report...")
|
||||
|
||||
# TODO - Delete
|
||||
current_directory = os.getcwd()
|
||||
logger.info(f"Current working directory: {current_directory}")
|
||||
|
||||
self.generate_current_federal_report(directory)
|
||||
logger.info(f"Success! Created {directory}current-federal.csv")
|
||||
|
||||
def generate_current_federal_report(self, directory):
|
||||
"""Creates a current-full.csv file under the migrationdata/ directory"""
|
||||
# TODO - #1403, push to the S3 instance instead
|
||||
file_path = os.path.join(directory, "current-federal.csv")
|
||||
with open(file_path, "w") as file:
|
||||
csv_export.export_data_federal_to_csv(file)
|
||||
|
|
|
@ -21,15 +21,12 @@ class Command(BaseCommand):
|
|||
directory = os.path.join(options.get("directory"), "")
|
||||
logger.info("Generating report...")
|
||||
|
||||
# TODO - Delete
|
||||
current_directory = os.getcwd()
|
||||
logger.info(f"Current working directory: {current_directory}")
|
||||
|
||||
self.generate_current_full_report(directory)
|
||||
logger.info(f"Success! Created {directory}current-full.csv")
|
||||
|
||||
def generate_current_full_report(self, directory):
|
||||
"""Creates a current-full.csv file under the migrationdata/ directory"""
|
||||
# TODO - #1403, push to the S3 instance instead
|
||||
file_path = os.path.join(directory, "current-full.csv")
|
||||
with open(file_path, "w") as file:
|
||||
csv_export.export_data_full_to_csv(file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue