diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index 8f2e62f..c3ceaea 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -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] diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 3103e3e..84a196a 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -470,7 +470,7 @@ def updatequeue(request): last_checked_adoption_list = AdoptionNotice.objects.order_by("last_checked") else: last_checked_adoption_list = AdoptionNotice.objects.filter(owner=request.user).order_by("last_checked") - adoption_notices = [adoption for adoption in last_checked_adoption_list if adoption.is_active] + adoption_notices = [adoption for adoption in last_checked_adoption_list if adoption.is_active or adoption.is_to_be_checked] context = {"adoption_notices": adoption_notices} return render(request, 'fellchensammlung/updatequeue.html', context=context)