broadcasts: do not send description to cbc_proxy

"areas" and "simple_polygons" in "transmitted_areas" do not have the
same length

as an example, choosing the area "england" results in a single item in
"areas" but many polygons in "simple_polygons"

therefore zipping these two together gives a list of areas:
* of length 1
* containing only new grimsby

which is not what we want

as the CBC does not care about the areaDesc field within CAP, we should
omit it from the function invocation and delegate the contents of
areaDesc to the CBC Proxy implementation

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
Co-authored-by: Richard <richard.baker@digital.cabinet-office.gov.uk>
Co-authored-by: David <david.mcdonald@digital.cabinet-office.gov.uk>
This commit is contained in:
Toby Lorne
2020-10-26 15:16:33 +00:00
parent ca2bea8ae6
commit d22adb7813
2 changed files with 2 additions and 8 deletions

View File

@@ -19,11 +19,8 @@ def send_broadcast_event(broadcast_event_id):
)
areas = [
{"description": desc, "polygon": polygon}
for desc, polygon in zip(
broadcast_event.transmitted_areas["areas"],
broadcast_event.transmitted_areas["simple_polygons"],
)
{"polygon": polygon}
for polygon in broadcast_event.transmitted_areas["simple_polygons"]
]
if broadcast_event.message_type == BroadcastEventMessageType.ALERT: