From 87a0204fe2f74e6c7ba67af8d7a17799f90e3ae8 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 8 May 2024 08:36:39 -0700 Subject: [PATCH 1/3] explain how to create a first user in the db --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index f907dca88..ebbb5af88 100644 --- a/README.md +++ b/README.md @@ -351,6 +351,28 @@ This will run the local development web server and make the admin site available at http://localhost:6012; remember to make sure that the Notify.gov API is running as well! +## Creating a 'First User' in the database + +After you have completed all setup steps, you will be unable to log in, because there +will not be a user in the database to link to the login.gov account you are using. So +you will need to create that user in your database using the 'create-test-user' command. + +Open two terminals pointing to the api project and then run these commands in the +respective terminals. Make sure the email address is the same one you are using in +login.gov and make sure your phone number is in the format 5555555555. + +(Server 1) +env ALLOW_EXPIRED_API_TOKEN=1 make run-flask + +(Server 2) +poetry run flask command create-admin-jwt | tail -n 1 | pbcopy +poetry run flask command create-test-user --name="" --email="" --mobile_number="" --password="" --admin=True; + +If for any reason in the course of development it is necessary for your to delete your db +via the `dropdb` command, you will need to repeat these steps when you recreate your db. + + + ## Git Hooks We're using [`pre-commit`](https://pre-commit.com/) to manage hooks in order to From b79835dfd2cd2556a51c8b1e3f58e9abe151cd00 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 8 May 2024 09:10:41 -0700 Subject: [PATCH 2/3] code review feedback --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ebbb5af88..0d7ffc5bc 100644 --- a/README.md +++ b/README.md @@ -358,15 +358,17 @@ will not be a user in the database to link to the login.gov account you are usin you will need to create that user in your database using the 'create-test-user' command. Open two terminals pointing to the api project and then run these commands in the -respective terminals. Make sure the email address is the same one you are using in -login.gov and make sure your phone number is in the format 5555555555. +respective terminals. (Server 1) env ALLOW_EXPIRED_API_TOKEN=1 make run-flask (Server 2) poetry run flask command create-admin-jwt | tail -n 1 | pbcopy -poetry run flask command create-test-user --name="" --email="" --mobile_number="" --password="" --admin=True; +poetry run flask command create-test-user --admin=True; + +Supply your name, email address, mobile number, and password when prompted. Make sure the email address +is the same one you are using in login.gov and make sure your phone number is in the format 5555555555. If for any reason in the course of development it is necessary for your to delete your db via the `dropdb` command, you will need to repeat these steps when you recreate your db. From 85ddd494b35d728cbb4dbaaff6e130f7c2804c25 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 9 May 2024 07:33:26 -0700 Subject: [PATCH 3/3] remove debug statement --- app/utils/csv.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/utils/csv.py b/app/utils/csv.py index 04d5d19ed..e6119b073 100644 --- a/app/utils/csv.py +++ b/app/utils/csv.py @@ -1,7 +1,6 @@ import datetime import pytz -from flask import current_app from flask_login import current_user from notifications_utils.recipients import RecipientCSV @@ -67,7 +66,6 @@ def generate_notifications_csv(**kwargs): from app import notification_api_client from app.s3_client.s3_csv_client import s3download - current_app.logger.info("\n\n\n\nENTER generate_notifications_csv") if "page" not in kwargs: kwargs["page"] = 1