diff --git a/fragdenstaat_de/fds_blog/views.py b/fragdenstaat_de/fds_blog/views.py index aa673ee40..6c49fe5f6 100644 --- a/fragdenstaat_de/fds_blog/views.py +++ b/fragdenstaat_de/fds_blog/views.py @@ -123,18 +123,16 @@ class ArticleListView(BaseBlogListView, ListView): def get_queryset(self): qs = super().get_queryset() + featured = ( + qs.filter(date_featured__isnull=False).order_by("-date_featured").first() + ) self.featured = None page = self.request.GET.get("page", None) if not page or page == "1": - try: - self.featured = qs.filter(date_featured__isnull=False).order_by( - "-date_featured" - )[0] - except IndexError: - pass - - if self.featured is not None: - qs = qs.exclude(pk=self.featured.pk) + self.featured = featured + + if featured is not None: + qs = qs.exclude(pk=featured.pk) return qs def get_context_data(self, **kwargs):