clients: cbc_proxy actions accepts areas param

related:
https://github.com/alphagov/notifications-broadcasts-infra/pull/23

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
This commit is contained in:
Toby Lorne
2020-10-23 16:44:11 +01:00
parent d9ceed55b5
commit aa002afd31
4 changed files with 72 additions and 6 deletions

View File

@@ -20,10 +20,19 @@ def send_broadcast_event(broadcast_event_id, provider='stub-1'):
f'msgType {broadcast_event.message_type} to {provider}'
)
areas = [
{"description": desc, "polygon": polygon}
for desc, polygon in zip(
broadcast_event.transmitted_areas["areas"],
broadcast_event.transmitted_areas["simple_polygons"],
)
]
cbc_proxy_client.create_and_send_broadcast(
identifier=str(broadcast_event.id),
headline="GOV.UK Notify Broadcast",
description=broadcast_event.transmitted_content['body'],
areas=areas,
)
current_app.logger.info(