feat: Divide adoption notices of org by active and inactive

This commit is contained in:
2025-08-11 12:58:02 +02:00
parent 1434e7502a
commit 30ff26c7ef
2 changed files with 40 additions and 9 deletions

View File

@@ -216,6 +216,18 @@ class RescueOrganization(models.Model):
adoption_notices_discovered.extend(child.adoption_notices_in_hierarchy)
return adoption_notices_discovered
@property
def adoption_notices_in_hierarchy_divided_by_status(self):
"""Returns two lists of adoption notices, the first active, the other inactive."""
active_adoption_notices = []
inactive_adoption_notices = []
for an in self.adoption_notices_in_hierarchy:
if an.is_active:
active_adoption_notices.append(an)
else:
inactive_adoption_notices.append(an)
return active_adoption_notices, inactive_adoption_notices
@property
def position(self):
if self.location: