feat: show all ANs to be checked, not only active ones

This commit is contained in:
2024-10-26 08:52:59 +02:00
parent 0e67b777b5
commit c1e3248cc8
2 changed files with 11 additions and 1 deletions

View File

@@ -287,6 +287,12 @@ class AdoptionNotice(models.Model):
return False
return self.adoptionnoticestatus.is_active
@property
def is_to_be_checked(self, include_active=False):
if not hasattr(self, 'adoptionnoticestatus'):
return False
return self.adoptionnoticestatus.is_to_be_checked or (include_active and self.adoptionnoticestatus.is_active)
def set_checked(self):
self.last_checked = datetime.now()
self.save()
@@ -353,6 +359,10 @@ class AdoptionNoticeStatus(models.Model):
def is_active(self):
return self.major_status == self.ACTIVE
@property
def is_to_be_checked(self):
return self.major_status == self.DISABLED and self.minor_status == "unchecked"
@staticmethod
def get_minor_choices(major_status):
return AdoptionNoticeStatus.MINOR_STATUS_CHOICES[major_status]