From 5f077edeb6af46bd6441b5eba7c954fa93685aee Mon Sep 17 00:00:00 2001 From: moanos Date: Fri, 9 Aug 2024 07:43:57 +0200 Subject: [PATCH] feat: Filter for active ANs first --- src/fellchensammlung/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 1517312..7820c96 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -38,7 +38,7 @@ def fail_if_user_not_owner_or_trust_level(user, django_object, trust_level=User. def index(request): """View function for home page of site.""" - latest_adoption_list = AdoptionNotice.objects.order_by("-created_at")[:5] + latest_adoption_list = AdoptionNotice.objects.filter(adoptionnoticestatus__major_status=AdoptionNoticeStatus.ACTIVE).order_by("-created_at")[:5] active_adoptions = [adoption for adoption in latest_adoption_list if adoption.is_active] language_code = translation.get_language() lang = Language.objects.get(languagecode=language_code)