Merge pull request #3155 from alphagov/migrate-broadcast-settings

Backfill services_broadcast_settings table
This commit is contained in:
David McDonald
2021-02-25 12:16:36 +00:00
committed by GitHub
6 changed files with 97 additions and 138 deletions

View File

@@ -140,10 +140,6 @@ def send_broadcast_provider_message(self, broadcast_event_id, provider):
for polygon in broadcast_event.transmitted_areas["simple_polygons"]
]
channel = "test"
if broadcast_event.service.broadcast_channel:
channel = broadcast_event.service.broadcast_channel
cbc_proxy_provider_client = cbc_proxy_client.get_proxy(provider)
try:
@@ -156,7 +152,7 @@ def send_broadcast_provider_message(self, broadcast_event_id, provider):
areas=areas,
sent=broadcast_event.sent_at_as_cap_datetime_string,
expires=broadcast_event.transmitted_finishes_at_as_cap_datetime_string,
channel=channel
channel=broadcast_event.service.broadcast_channel
)
elif broadcast_event.message_type == BroadcastEventMessageType.UPDATE:
cbc_proxy_provider_client.update_and_send_broadcast(
@@ -174,7 +170,7 @@ def send_broadcast_provider_message(self, broadcast_event_id, provider):
# but we are relying on service channels changing almost never, and not mid incident
# We may consider in the future, changing this such that we store the channel a broadcast was
# sent on on the broadcast message itself and pick the value from there instead of the service
channel=channel
channel=broadcast_event.service.broadcast_channel
)
elif broadcast_event.message_type == BroadcastEventMessageType.CANCEL:
cbc_proxy_provider_client.cancel_broadcast(