mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-27 11:19:21 -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:
@@ -124,11 +124,11 @@ class BroadcastArea(BaseBroadcastArea, SortableMixin):
|
||||
return self._count_of_phones or 0
|
||||
|
||||
@cached_property
|
||||
def parents(self):
|
||||
return list(self._parents_iterator)
|
||||
def ancestors(self):
|
||||
return list(self._ancestors_iterator)
|
||||
|
||||
@property
|
||||
def _parents_iterator(self):
|
||||
def _ancestors_iterator(self):
|
||||
id = self.id
|
||||
|
||||
while True:
|
||||
@@ -138,9 +138,7 @@ class BroadcastArea(BaseBroadcastArea, SortableMixin):
|
||||
return
|
||||
|
||||
parent_broadcast_area = BroadcastArea(parent)
|
||||
|
||||
yield parent_broadcast_area
|
||||
|
||||
id = parent_broadcast_area.id
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user