mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05:00
Start sending aggregate area names to API
The aggregate names don't need to be sorted, but it helps to do this for the tests, since the implementation of sets may not be stable between machines and lead to sporadic test failures. I did also toy with sorting granular area names so they have a similar ordering, but this would take them out-of-order with IDs and really the important thing is that the ordering is stable.
This commit is contained in:
@@ -11,6 +11,7 @@ from app.broadcast_areas.models import (
|
||||
CustomBroadcastAreas,
|
||||
broadcast_area_libraries,
|
||||
)
|
||||
from app.broadcast_areas.utils import aggregate_areas
|
||||
from app.formatters import round_to_significant_figures
|
||||
from app.models import JSONModel, ModelList
|
||||
from app.models.user import User
|
||||
@@ -244,6 +245,7 @@ class BroadcastMessage(JSONModel):
|
||||
areas = {
|
||||
'ids': self.area_ids,
|
||||
'names': [area.name for area in self.areas],
|
||||
'aggregate_names': [area.name for area in aggregate_areas(self.areas)],
|
||||
'simple_polygons': self.simple_polygons.as_coordinate_pairs_lat_long
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user