mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-07 06:50:56 -04:00
Rename "parents" methods to "ancestors"
Resolves: https://github.com/alphagov/notifications-admin/pull/3980#discussion_r694002952 A grandparent is not a parent, so the return value of these methods were misleading. This makes it clearer.
This commit is contained in:
@@ -104,14 +104,14 @@ class BroadcastMessage(JSONModel):
|
||||
)
|
||||
|
||||
@property
|
||||
def parent_areas(self):
|
||||
return sorted(set(self._parent_areas_iterator))
|
||||
def ancestor_areas(self):
|
||||
return sorted(set(self._ancestor_areas_iterator))
|
||||
|
||||
@property
|
||||
def _parent_areas_iterator(self):
|
||||
def _ancestor_areas_iterator(self):
|
||||
for area in self.areas:
|
||||
for parent in area.parents:
|
||||
yield parent
|
||||
for ancestor in area.ancestors:
|
||||
yield ancestor
|
||||
|
||||
@cached_property
|
||||
def polygons(self):
|
||||
|
||||
Reference in New Issue
Block a user