feat: show all ANs to be checked, not only active ones
This commit is contained in:
parent
0e67b777b5
commit
c1e3248cc8
@ -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]
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user