mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Support custom broadcasts (without area IDs)
Custom broadcasts created directly via the API app won't have area
IDs since [1], where we started to distinguish between "names" (all
broadcasts have these) and IDs (for broadcasts created in this app).
We forgot to propagate the distinction into the code here.
This code fixes the bug for all broadcasts created after [1]. Any
custom broadcasts created before [1] will have their "ids" field set
instead of "names" so we won't show anything for them. This seems
reasonable as we don't support custom broadcasts yet.
[1]: 023a06d5fb
This commit is contained in:
@@ -678,6 +678,7 @@ def broadcast_message_json(
|
||||
updated_at=None,
|
||||
approved_by_id=None,
|
||||
cancelled_by_id=None,
|
||||
areas=None,
|
||||
area_ids=None,
|
||||
simple_polygons=None,
|
||||
content=None,
|
||||
@@ -696,7 +697,7 @@ def broadcast_message_json(
|
||||
'reference': reference,
|
||||
|
||||
'personalisation': {},
|
||||
'areas': {
|
||||
'areas': areas or {
|
||||
'ids': area_ids or ['ctry19-E92000001', 'ctry19-S92000003'],
|
||||
'simple_polygons': simple_polygons or [],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user