Skip to content

Commit

Permalink
remove emergency alerts code
Browse files Browse the repository at this point in the history
no longer used. there might be additional cleanup we can do of other
utils functions that dont have "alert" or "broadcast" in the name that
are no longer used
  • Loading branch information
leohemsted committed Jan 10, 2024
1 parent f5c0ece commit 3f802e4
Show file tree
Hide file tree
Showing 28 changed files with 30 additions and 1,595 deletions.
4 changes: 0 additions & 4 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from werkzeug.local import LocalProxy

from app.clients import NotificationProviderClients
from app.clients.cbc_proxy import CBCProxyClient
from app.clients.document_download import DocumentDownloadClient
from app.clients.email.aws_ses import AwsSesClient
from app.clients.email.aws_ses_stub import AwsSesStubClient
Expand All @@ -51,7 +50,6 @@
zendesk_client = ZendeskClient()
statsd_client = StatsdClient()
redis_store = RedisClient()
cbc_proxy_client = CBCProxyClient()
document_download_client = DocumentDownloadClient()
metrics = GDSMetrics()

Expand Down Expand Up @@ -104,8 +102,6 @@ def create_app(application):
redis_store.init_app(application)
document_download_client.init_app(application)

cbc_proxy_client.init_app(application)

register_blueprint(application)
register_v2_blueprints(application)

Expand Down
6 changes: 2 additions & 4 deletions app/celery/nightly_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,8 @@ def delete_unneeded_notification_history_by_hour():
# We pass datetimes as args to the next task but celery will actually call `isoformat` on these
# and send them over as strings
[start_datetime, end_datetime],
# We use the broadcasts queue temporarily as it pulled from by a worker doing no work
# We don't want to put the tasks on the periodic queue because they make take up all
# the workers capacity, stopping other important tasks from happening
queue=QueueNames.BROADCASTS,
# We use the reporting queue as it's not used for most of the day
queue=QueueNames.REPORTING,
)
current_app.logger.info(
"Created delete_unneeded_notification_history_for_specific_hour task between %s and %s",
Expand Down
298 changes: 0 additions & 298 deletions app/clients/cbc_proxy.py

This file was deleted.

31 changes: 0 additions & 31 deletions app/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
dao_get_organisation_by_email_address,
dao_get_organisation_by_id,
)
from app.dao.permissions_dao import permission_dao
from app.dao.services_dao import (
dao_create_service,
dao_fetch_all_services_by_user,
Expand All @@ -66,7 +65,6 @@
LetterBranding,
Notification,
Organisation,
Permission,
Service,
Template,
User,
Expand Down Expand Up @@ -789,35 +787,6 @@ def populate_annual_billing_with_the_previous_years_allowance(year):
)


@click.option("-u", "--user-id", required=True)
@notify_command(name="local-dev-broadcast-permissions")
def local_dev_broadcast_permissions(user_id):
if os.getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
current_app.logger.error("Can only be run in development")
return

user = User.query.filter_by(id=user_id).one()

user_broadcast_services = Service.query.filter(
Service.permissions.any(permission="broadcast"), Service.users.any(id=user_id)
)

for service in user_broadcast_services:
permission_list = [
Permission(service_id=service.id, user_id=user_id, permission=permission)
for permission in [
"reject_broadcasts",
"cancel_broadcasts", # required to create / approve
"create_broadcasts",
"approve_broadcasts", # minimum for testing
"manage_templates", # unlikely but might be useful
"view_activity", # normally added on invite / service creation
]
]

permission_dao.set_user_service_permission(user, service, permission_list, _commit=True, replace=True)


@click.option("-u", "--user-id", required=True)
@notify_command(name="generate-bulktest-data")
def generate_bulktest_data(user_id):
Expand Down
Loading

0 comments on commit 3f802e4

Please sign in to comment.