From 141dd51b52b0accf995ede4064ce8420e58109dd Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 2 Jul 2024 08:50:48 -0700 Subject: [PATCH] code review feedback --- app/commands.py | 17 +++++++++-------- docs/all.md | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/commands.py b/app/commands.py index 898ecdb89..d8b9d283e 100644 --- a/app/commands.py +++ b/app/commands.py @@ -593,10 +593,10 @@ def process_row_from_job(job_id, job_row_number): @click.option("-f", "--csv_filename", required=True, help="csv file name") def download_csv_file_by_name(csv_filename): - bucket_name = getenv("CSV_BUCKET_NAME") - access_key = getenv("CSV_AWS_ACCESS_KEY_ID") - secret = getenv("CSV_AWS_SECRET_ACCESS_KEY") - region = getenv("CSV_AWS_REGION") + bucket_name = (current_app.config["CSV_UPLOAD_BUCKET"]["bucket"],) + access_key = (current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"],) + secret = (current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"],) + region = (current_app.config["CSV_UPLOAD_BUCKET"]["region"],) print(s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region)) @@ -865,10 +865,11 @@ def promote_user_to_platform_admin(user_email_address): @notify_command(name="purge-csv-bucket") def purge_csv_bucket(): - bucket_name = getenv("CSV_BUCKET_NAME") - access_key = getenv("CSV_AWS_ACCESS_KEY_ID") - secret = getenv("CSV_AWS_SECRET_ACCESS_KEY") - region = getenv("CSV_AWS_REGION") + bucket_name = (current_app.config["CSV_UPLOAD_BUCKET"]["bucket"],) + access_key = (current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"],) + secret = (current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"],) + region = (current_app.config["CSV_UPLOAD_BUCKET"]["region"],) + print("ABOUT TO RUN PURGE CSV BUCKET") s3.purge_bucket(bucket_name, access_key, secret, region) print("RAN PURGE CSV BUCKET") diff --git a/docs/all.md b/docs/all.md index 6ee0fbbf7..23d378ef5 100644 --- a/docs/all.md +++ b/docs/all.md @@ -1243,7 +1243,7 @@ In the api logs, search by job_id. Either you will see evidence of the job fail ## Viewing the csv file -If you need to view th questionable csv file, run the following command: +If you need to view the questionable csv file, run the following command: ```