mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Add function method to aggregate areas
This is standalone for now - we'll plumb it in later.
This commit is contained in:
10
app/broadcast_areas/utils.py
Normal file
10
app/broadcast_areas/utils.py
Normal file
@@ -0,0 +1,10 @@
|
||||
def aggregate_areas(areas):
|
||||
areas = _aggregate_wards_by_local_authority(areas)
|
||||
return areas
|
||||
|
||||
|
||||
def _aggregate_wards_by_local_authority(areas):
|
||||
return {
|
||||
area.parent if area.id.startswith('wd20-')
|
||||
else area for area in areas
|
||||
}
|
||||
Reference in New Issue
Block a user