mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Support broadcasts with no areas data
Previously we used to return an empty CustomBroadcastAreas object, which doesn't make sense for broadcasts created in this app.
This commit is contained in:
@@ -99,10 +99,15 @@ class BroadcastMessage(JSONModel):
|
||||
)
|
||||
return library_areas
|
||||
|
||||
return CustomBroadcastAreas(
|
||||
names=self._dict['areas']['names'],
|
||||
polygons=self._dict['areas']['simple_polygons'],
|
||||
)
|
||||
polygons = self._dict['areas'].get('simple_polygons', [])
|
||||
|
||||
if polygons:
|
||||
return CustomBroadcastAreas(
|
||||
names=self._dict['areas']['names'],
|
||||
polygons=polygons,
|
||||
)
|
||||
|
||||
return []
|
||||
|
||||
@property
|
||||
def area_ids(self):
|
||||
|
||||
Reference in New Issue
Block a user