move BroadcastProvider from models.py to config.py

It's not something that is tied to a database table, and was causing
circular import issues
This commit is contained in:
Leo Hemsted
2020-11-16 12:47:38 +00:00
parent bc3512467b
commit 7cc83e04eb
5 changed files with 74 additions and 30 deletions

View File

@@ -5,14 +5,14 @@ from notifications_utils.statsd_decorators import statsd
from app import cbc_proxy_client, notify_celery
from app.config import QueueNames
from app.models import BroadcastEventMessageType, BroadcastProvider
from app.models import BroadcastEventMessageType
from app.dao.broadcast_message_dao import dao_get_broadcast_event_by_id
@notify_celery.task(name="send-broadcast-event")
@statsd(namespace="tasks")
def send_broadcast_event(broadcast_event_id):
for provider in BroadcastProvider.PROVIDERS:
for provider in current_app.config['ENABLED_CBCS']:
# TODO: Decide whether to send to each provider based on platform admin, service level settings, broadcast
# level settings, etc.
send_broadcast_provider_message.apply_async(