Skip to content

Commit

Permalink
Merge pull request #1227 from GSA/wrong_phone_numbers
Browse files Browse the repository at this point in the history
new command to look at sms senders
  • Loading branch information
ccostino authored Jul 31, 2024
2 parents b47d4ac + 0b96a51 commit eab4dfa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
dao_get_organization_by_email_address,
dao_get_organization_by_id,
)
from app.dao.service_sms_sender_dao import dao_get_sms_senders_by_service_id
from app.dao.services_dao import (
dao_fetch_all_services_by_user,
dao_fetch_all_services_created_by_user,
dao_fetch_service_by_id,
dao_update_service,
delete_service_and_all_associated_db_objects,
get_services_by_partial_name,
)
from app.dao.templates_dao import dao_get_template_by_id
from app.dao.users_dao import (
Expand Down Expand Up @@ -600,6 +602,24 @@ def download_csv_file_by_name(csv_filename):
print(s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region))


@notify_command(name="dump-sms-senders")
@click.argument("service_name")
def dump_sms_senders(service_name):

# poetry run flask command dump-sms-senders MyServiceName
# cf run-task notify-api-production --command "flask command dump-sms-senders MyServiceName"
services = get_services_by_partial_name(service_name)
if len(services) > 1:
raise ValueError(
f"Please use a unique and complete service name instead of {service_name}"
)

senders = dao_get_sms_senders_by_service_id(services[0].id)
for sender in senders:
# Not PII, okay to put in logs
click.echo(sender.serialize())


@notify_command(name="populate-annual-billing-with-the-previous-years-allowance")
@click.option(
"-y",
Expand Down

0 comments on commit eab4dfa

Please sign in to comment.